### EVChargingStation Data Model Examples Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/EVChargingStation/README.md Provides links to example payloads for the EVChargingStation data model in various formats and versions. ```APIDOC ## EVChargingStation Data Model Examples ### Example Payloads - **NGSI v2 (keyvalues):** [https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example.json](https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example.json) - **NGSI-LD (keyvalues):** [https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example.jsonld](https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example.jsonld) - **NGSI-V2 (normalized):** [https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example-normalized.json](https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example-normalized.json) - **NGSI-LD (normalized):** [https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example-normalized.jsonld](https://smart-data-models.github.io/dataModel.Transportation/EVChargingStation/examples/example-normalized.jsonld) ### CSV Examples - **NGSI v2 (keyvalues, CSV):** [https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example.json.csv](https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example.json.csv) - **NGSI-LD (keyvalues, CSV):** [https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example.jsonld.csv](https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example.jsonld.csv) - **NGSI-V2 (normalized, CSV):** [https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example-normalized.json.csv](https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example-normalized.json.csv) - **NGSI-LD (normalized, CSV):** [https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example-normalized.jsonld.csv](https://github.com/smart-data-models/dataModel.Transportation/blob/master/EVChargingStation/examples/example-normalized.jsonld.csv) ``` -------------------------------- ### OriginDestinationFlow NGSI-v2 Key-Values Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/OriginDestinationFlow/doc/spec.md An example of an OriginDestinationFlow entity in JSON format, compatible with NGSI-v2 when using `options=keyValues`. ```APIDOC ## OriginDestinationFlow NGSI-v2 Key-Values Example ### Description This example shows the OriginDestinationFlow entity in a key-value format, suitable for NGSI-v2 with the `options=keyValues` query parameter. ### Method GET ### Endpoint `/ngsi-v2/entities` ### Parameters #### Query Parameters - **options** (string) - Optional - `keyValues` to get the entity in key-value format. ### Request Example ```json { "id": "OriginDestinationFlow:PT:CO0101:CO0102:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": "2024-12-31T10:30:00.00Z", "aggregationDateType": "hourly", "hour": 10, "originLocationCode": "CO0101", "originLocationName": "Coimbra", "destinationLocationCode": "CO0102", "destinationLocationName": "Figueira da Foz", "nationality": "DE", "nationalityName": "Germany", "flowCount": 145, "flowType": "tourism", "countryCode": "PT", "originLocation": { "type": "Point", "coordinates": [-8.4103, 40.2033] }, "destinationLocation": { "type": "Point", "coordinates": [-8.8618, 40.1508] }, "description": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00", "source": "MobilityDataPlatform", "dateCreated": "2024-12-31T11:00:00.00Z", "dateModified": "2024-12-31T11:00:00.00Z" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the entity. - **type** (string) - The type of the entity, which is 'OriginDestinationFlow'. - **dateObserved** (string) - The date and time when the observation was made. - **aggregationDateType** (string) - The type of date aggregation (e.g., 'hourly', 'daily'). - **hour** (number) - The hour of the day for the observation. - **originLocationCode** (string) - The code for the origin location. - **originLocationName** (string) - The name of the origin location. - **destinationLocationCode** (string) - The code for the destination location. - **destinationLocationName** (string) - The name of the destination location. - **nationality** (string) - The nationality code of the flow. - **nationalityName** (string) - The name of the nationality. - **flowCount** (number) - The number of entities in the flow. - **flowType** (string) - The type of flow (e.g., 'tourism', 'commute'). - **countryCode** (string) - The country code of the flow. - **originLocation** (object) - Geographic coordinates of the origin location. - **destinationLocation** (object) - Geographic coordinates of the destination location. - **description** (string) - A description of the flow. - **source** (string) - The source of the data. - **dateCreated** (string) - The date and time the entity was created. - **dateModified** (string) - The date and time the entity was last modified. #### Response Example ```json { "id": "OriginDestinationFlow:PT:CO0101:CO0102:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": "2024-12-31T10:30:00.00Z", "aggregationDateType": "hourly", "hour": 10, "originLocationCode": "CO0101", "originLocationName": "Coimbra", "destinationLocationCode": "CO0102", "destinationLocationName": "Figueira da Foz", "nationality": "DE", "nationalityName": "Germany", "flowCount": 145, "flowType": "tourism", "countryCode": "PT", "originLocation": { "type": "Point", "coordinates": [-8.4103, 40.2033] }, "destinationLocation": { "type": "Point", "coordinates": [-8.8618, 40.1508] }, "description": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00", "source": "MobilityDataPlatform", "dateCreated": "2024-12-31T11:00:00.00Z", "dateModified": "2024-12-31T11:00:00.00Z" } ``` ``` -------------------------------- ### OriginDestinationFlow NGSI-LD Key-Values Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/OriginDestinationFlow/doc/spec.md An example of an OriginDestinationFlow entity in JSON-LD format, compatible with NGSI-LD when using `options=keyValues`. ```APIDOC ## OriginDestinationFlow NGSI-LD Key-Values Example ### Description This example demonstrates the OriginDestinationFlow entity in JSON-LD format, using key-value pairs and including the `@context` for NGSI-LD compatibility. ### Method GET ### Endpoint `/ngsi-ld/entities` ### Parameters #### Query Parameters - **options** (string) - Optional - `keyValues` to get the entity in key-value format. ### Request Example ```json { "id": "urn:ngsi-ld:OriginDestinationFlow:PT:0602:0406:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": "2024-12-31T10:00:00.00Z", "aggregationDateType": "hourly", "hour": 10, "originLocationCode": "0602", "originLocationName": "Coimbra", "destinationLocationCode": "0406", "destinationLocationName": "Figueira da Foz", "nationality": "DE", "nationalityName": "Germany", "flowCount": 145, "flowType": "tourism", "countryCode": "PT", "originLocation": { "type": "Point", "coordinates": [-8.4103, 40.2033] }, "destinationLocation": { "type": "Point", "coordinates": [-8.8618, 40.1508] }, "description": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00", "source": "MobilityDataPlatform", "dateCreated": "2024-12-31T11:00:00.00Z", "dateModified": "2024-12-31T11:00:00.00Z", "@context": [ "https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/context.jsonld" ] } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the entity. - **type** (string) - The type of the entity, which is 'OriginDestinationFlow'. - **dateObserved** (string) - The date and time when the observation was made. - **aggregationDateType** (string) - The type of date aggregation (e.g., 'hourly', 'daily'). - **hour** (number) - The hour of the day for the observation. - **originLocationCode** (string) - The code for the origin location. - **originLocationName** (string) - The name of the origin location. - **destinationLocationCode** (string) - The code for the destination location. - **destinationLocationName** (string) - The name of the destination location. - **nationality** (string) - The nationality code of the flow. - **nationalityName** (string) - The name of the nationality. - **flowCount** (number) - The number of entities in the flow. - **flowType** (string) - The type of flow (e.g., 'tourism', 'commute'). - **countryCode** (string) - The country code of the flow. - **originLocation** (object) - Geographic coordinates of the origin location. - **destinationLocation** (object) - Geographic coordinates of the destination location. - **description** (string) - A description of the flow. - **source** (string) - The source of the data. - **dateCreated** (string) - The date and time the entity was created. - **dateModified** (string) - The date and time the entity was last modified. - **@context** (array) - The JSON-LD context. #### Response Example ```json { "id": "urn:ngsi-ld:OriginDestinationFlow:PT:0602:0406:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": "2024-12-31T10:00:00.00Z", "aggregationDateType": "hourly", "hour": 10, "originLocationCode": "0602", "originLocationName": "Coimbra", "destinationLocationCode": "0406", "destinationLocationName": "Figueira da Foz", "nationality": "DE", "nationalityName": "Germany", "flowCount": 145, "flowType": "tourism", "countryCode": "PT", "originLocation": { "type": "Point", "coordinates": [-8.4103, 40.2033] }, "destinationLocation": { "type": "Point", "coordinates": [-8.8618, 40.1508] }, "description": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00", "source": "MobilityDataPlatform", "dateCreated": "2024-12-31T11:00:00.00Z", "dateModified": "2024-12-31T11:00:00.00Z", "@context": [ "https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/context.jsonld" ] } ``` ``` -------------------------------- ### EVChargingStation Data Model Dynamic Example Generators Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/EVChargingStation/README.md Links to online generators for creating dynamic example payloads for the EVChargingStation data model. ```APIDOC ## EVChargingStation Data Model Dynamic Example Generators ### NGSI-LD Payload Generators - **NGSI-LD (normalized):** [https://smartdatamodels.org/extra/ngsi-ld_generator.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/EVChargingStation/schema.json&email=info@smartdatamodels.org](https://smartdatamodels.org/extra/ngsi-ld_generator.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/EVChargingStation/schema.json&email=info@smartdatamodels.org) - **NGSI-LD (keyvalues):** [https://smartdatamodels.org/extra/ngsi-ld_generator_keyvalues.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/EVChargingStation/schema.json&email=info@smartdatamodels.org](https://smartdatamodels.org/extra/ngsi-ld_generator_keyvalues.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/EVChargingStation/schema.json&email=info@smartdatamodels.org) ### GeoJSON Generator - **GeoJSON Feature Format:** [https://smartdatamodels.org/extra/geojson_features_generator.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/EVChargingStation/schema.json&email=info@smartdatamodels.org](https://smartdatamodels.org/extra/geojson_features_generator.php?schemaUrl=https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/EVChargingStation/schema.json&email=info@smartdatamodels.org) ``` -------------------------------- ### OriginDestinationFlow NGSI-v2 Key-Value Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/OriginDestinationFlow/doc/spec_ZH.md An example of the OriginDestinationFlow entity in NGSI-v2 key-value format, suitable for direct use with an Orion Context Broker. ```APIDOC ## OriginDestinationFlow Data Model Example ### Description This example demonstrates the structure of an OriginDestinationFlow entity using the NGSI-v2 key-value format. It represents hourly visitor flow data between two locations. ### Method N/A (Example Payload) ### Endpoint N/A (Example Payload) ### Parameters N/A (Example Payload) ### Request Example ```json { "id": "OriginDestinationFlow:PT:CO0101:CO0102:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": "2024-12-31T10:30:00.00Z", "aggregationDateType": "hourly", "hour": 10, "originLocationCode": "CO0101", "originLocationName": "Coimbra", "destinationLocationCode": "CO0102", "destinationLocationName": "Figueira da Foz", "nationality": "DE", "nationalityName": "Germany", "flowCount": 145, "flowType": "tourism", "countryCode": "PT", "originLocation": { "type": "Point", "coordinates": [-8.4103, 40.2033] }, "destinationLocation": { "type": "Point", "coordinates": [-8.8618, 40.1508] }, "description": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00", "source": "MobilityDataPlatform", "dateCreated": "2024-12-31T11:00:00.00Z", "dateModified": "2024-12-31T11:00:00.00Z" } ``` ### Response #### Success Response (200) N/A (Example Payload) #### Response Example N/A (Example Payload) ``` -------------------------------- ### OriginDestinationFlow NGSI-v2 Normalized Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/OriginDestinationFlow/doc/spec.md An example of an OriginDestinationFlow entity in JSON format, compatible with NGSI-v2 in its normalized form. ```APIDOC ## OriginDestinationFlow NGSI-v2 Normalized Example ### Description This example shows the OriginDestinationFlow entity in a normalized JSON format, which is the default for NGSI-v2 when no specific options are used. ### Method GET ### Endpoint `/ngsi-v2/entities` ### Parameters #### Query Parameters None (default normalized format). ### Request Example ```json { "id": "urn:ngsi-ld:OriginDestinationFlow:PT:CO0101:CO0102:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": { "type": "DateTime", "value": "2024-12-31T10:30:00.00Z" }, "aggregationDateType": { "type": "Text", "value": "hourly" }, "hour": { "type": "Number", "value": 10 }, "originLocationCode": { "type": "Text", "value": "CO0101" }, "originLocationName": { "type": "Text", "value": "Coimbra" }, "destinationLocationCode": { "type": "Text", "value": "CO0102" }, "destinationLocationName": { "type": "Text", "value": "Figueira da Foz" }, "nationality": { "type": "Text", "value": "DE" }, "nationalityName": { "type": "Text", "value": "Germany" }, "flowCount": { "type": "Number", "value": 145 }, "flowType": { "type": "Text", "value": "tourism" }, "countryCode": { "type": "Text", "value": "PT" }, "originLocation": { "type": "geo:json", "value": { "type": "Point", "coordinates": [-8.4103, 40.2033] } }, "destinationLocation": { "type": "geo:json", "value": { "type": "Point", "coordinates": [-8.8618, 40.1508] } }, "description": { "type": "Text", "value": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00" }, "source": { "type": "Text", "value": "MobilityDataPlatform" }, "dateCreated": { "type": "DateTime", "value": "2024-12-31T11:00:00.00Z" }, "dateModified": { "type": "DateTime", "value": "2024-12-31T11:00:00.00Z" } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the entity. - **type** (string) - The type of the entity, which is 'OriginDestinationFlow'. - **dateObserved** (object) - Contains the type and value for the observation date and time. - **aggregationDateType** (object) - Contains the type and value for the aggregation date type. - **hour** (object) - Contains the type and value for the hour of the day. - **originLocationCode** (object) - Contains the type and value for the origin location code. - **originLocationName** (object) - Contains the type and value for the origin location name. - **destinationLocationCode** (object) - Contains the type and value for the destination location code. - **destinationLocationName** (object) - Contains the type and value for the destination location name. - **nationality** (object) - Contains the type and value for the nationality code. - **nationalityName** (object) - Contains the type and value for the nationality name. - **flowCount** (object) - Contains the type and value for the flow count. - **flowType** (object) - Contains the type and value for the flow type. - **countryCode** (object) - Contains the type and value for the country code. - **originLocation** (object) - Contains the type and value for the origin geographic coordinates. - **destinationLocation** (object) - Contains the type and value for the destination geographic coordinates. - **description** (object) - Contains the type and value for the description. - **source** (object) - Contains the type and value for the data source. - **dateCreated** (object) - Contains the type and value for the creation date. - **dateModified** (object) - Contains the type and value for the modification date. #### Response Example ```json { "id": "urn:ngsi-ld:OriginDestinationFlow:PT:CO0101:CO0102:DE:20241231T10", "type": "OriginDestinationFlow", "dateObserved": { "type": "DateTime", "value": "2024-12-31T10:30:00.00Z" }, "aggregationDateType": { "type": "Text", "value": "hourly" }, "hour": { "type": "Number", "value": 10 }, "originLocationCode": { "type": "Text", "value": "CO0101" }, "originLocationName": { "type": "Text", "value": "Coimbra" }, "destinationLocationCode": { "type": "Text", "value": "CO0102" }, "destinationLocationName": { "type": "Text", "value": "Figueira da Foz" }, "nationality": { "type": "Text", "value": "DE" }, "nationalityName": { "type": "Text", "value": "Germany" }, "flowCount": { "type": "Number", "value": 145 }, "flowType": { "type": "Text", "value": "tourism" }, "countryCode": { "type": "Text", "value": "PT" }, "originLocation": { "type": "geo:json", "value": { "type": "Point", "coordinates": [-8.4103, 40.2033] } }, "destinationLocation": { "type": "geo:json", "value": { "type": "Point", "coordinates": [-8.8618, 40.1508] } }, "description": { "type": "Text", "value": "Hourly visitor flow from Coimbra to Figueira da Foz (German tourists) on 2024-12-31 at 10:00-11:00" }, "source": { "type": "Text", "value": "MobilityDataPlatform" }, "dateCreated": { "type": "DateTime", "value": "2024-12-31T11:00:00.00Z" }, "dateModified": { "type": "DateTime", "value": "2024-12-31T11:00:00.00Z" } } ``` ``` -------------------------------- ### AnonymousCommuterId Example (Key-Values) Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/AnonymousCommuterId/doc/spec_FR.md An example of an AnonymousCommuterId entity in JSON-LD format, compatible with NGSI-v2 key-values. ```APIDOC ## AnonymousCommuterId Example (Key-Values) ### Description Example of an AnonymousCommuterId entity in JSON-LD format, compatible with NGSI-v2 key-values. ### Request Example ```json { "id": "ngsi-ld:HUES:001", "anonymizedId": "D20220AC3478565F", "type": "AnonymousCommuterId", "date": "2022-09-05T08:25:35.00Z", "orig": "City hall", "dest": "Library", "source": "People Monitoring", "algorithm": "SHA1", "dateCreated": "2022-09-05T09:25:35.00Z", "dateModified": "2022-09-12T09:25:35.00Z", "location": { "type": "Point", "coordinates": [ 43.23161118206764, -2.844695196525928 ] } } ``` ``` -------------------------------- ### FareCollectionSystem Entity Example (JSON-LD) Source: https://context7.com/smart-data-models/datamodel.transportation/llms.txt Example JSON-LD representation of the FareCollectionSystem entity, detailing fare collection data for public transit. ```json { "id": "urn:ngsi-ld:FareCollectionSystem:id:RJSB:34513580", "type": "FareCollectionSystem", "address": { "addressCountry": "France", "addressLocality": "Nice", "streetAddress": "Av. Nicolas II" }, "name": "Fare collection system Nize", "cardId": "987201910", "currentTripCount": 12, "originStopId": "9", "originStopName": "Vauban", "destinationStopId": "Nice-Airport", "destinationStopCategory": "Airport", "fareForAdult": 4.5, "fareForChild": 3.6, "route_id": "4", "trip_id": "4A", "passengerCount": 6, "travelDistance": 7.5, "transactionDateTime": "2021-08-20T15:45:22Z", "transactionType": "Issue", "ticketTypeCode": "Normal", "occupancyLevel": "Green" } ``` -------------------------------- ### GET /SpecialRestriction Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/SpecialRestriction/README.md Retrieves the schema and example payloads for the SpecialRestriction data model. ```APIDOC ## GET /SpecialRestriction ### Description Retrieves the definition and example payloads for the SpecialRestriction entity, which specializes restrictions in restricted traffic areas. ### Method GET ### Endpoint /SpecialRestriction ### Parameters #### Query Parameters - **format** (string) - Optional - The desired format (json, jsonld, csv). - **type** (string) - Optional - The representation type (keyvalues, normalized). ### Request Example GET /SpecialRestriction?format=jsonld&type=normalized ### Response #### Success Response (200) - **schema** (object) - The JSON schema definition for the SpecialRestriction model. - **examples** (array) - A collection of valid payload examples. #### Response Example { "id": "urn:ngsi-ld:SpecialRestriction:123", "type": "SpecialRestriction", "description": "Restriction for heavy vehicles", "refRestrictedTrafficArea": "urn:ngsi-ld:RestrictedTrafficArea:456" } ``` -------------------------------- ### Using BikeHireDockingStation Data Model in Python Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/BikeHireDockingStation/code/README.md This Python script demonstrates how to use the BikeHireDockingStation data model. It likely involves creating, reading, or manipulating data related to bike hire docking stations. ```python from import BikeHireDockingStation # Example usage (assuming BikeHireDockingStation is a class or module) docking_station_data = { "id": "urn:ngsi-ld:BikeHireDockingStation:Station1", "type": "BikeHireDockingStation", "name": "Central Station Docks", "address": { "streetAddress": "123 Main St", "addressLocality": "Anytown", "addressRegion": "CA", "postalCode": "90210", "addressCountry": "US" }, "location": { "type": "Point", "coordinates": [-73.9857, 40.7484] }, "capacity": 50, "numBikesAvailable": 25, "numDocksAvailable": 25, "stationStatus": "open" } # Instantiate or use the data model # This part would depend on the specific library or framework used # For example, if using a library like 'fiware-client': # client.create_entity(docking_station_data) print("BikeHireDockingStation data model example prepared.") ``` -------------------------------- ### GET /transportation/road-segments Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/RoadSegment/doc/spec_DE.md Retrieves information about a specific road segment, including its classification, material, and geographic start point. ```APIDOC ## GET /transportation/road-segments ### Description Retrieves the details of a road segment entity including road classification, material, and physical dimensions. ### Method GET ### Endpoint /transportation/road-segments/{roadId} ### Parameters #### Path Parameters - **roadId** (string) - Required - Unique identifier for the road segment. ### Request Example GET /transportation/road-segments/road-123 ### Response #### Success Response (200) - **roadClass** (string) - The classification of the road (e.g., NATIONAL_HIGHWAY). - **roadMaterial** (string) - The construction material used for the carriageway. - **rightOfWayWidth** (number) - Total land area width available for the roadway. - **startPoint** (object) - GeoJSON representation of the segment start point. #### Response Example { "roadId": "road-123", "roadClass": "NATIONAL_HIGHWAY", "roadMaterial": "concrete", "rightOfWayWidth": 25.5, "startPoint": { "type": "Point", "coordinates": [12.5, 45.2] } } ``` -------------------------------- ### GET /road-segments Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/RoadSegment/doc/spec_JA.md Retrieves information about road segments, including their classification, physical dimensions, and geographical start points. ```APIDOC ## GET /road-segments ### Description Retrieves a list of road segments with their associated metadata such as road class, material, and directional information. ### Method GET ### Endpoint /road-segments ### Parameters #### Query Parameters - **roadId** (string) - Optional - Filter by unique road identifier. - **roadClass** (string) - Optional - Filter by road classification (e.g., NATIONAL_HIGHWAY, CITY_ROAD). ### Request Example GET /road-segments?roadClass=NATIONAL_HIGHWAY ### Response #### Success Response (200) - **roadId** (string) - Unique identifier of the road. - **roadClass** (string) - Classification of the road. - **rightOfWayWidth** (number) - Total land area width in meters. - **startPoint** (object) - GeoJSON representation of the segment start. #### Response Example { "roadId": "ROAD_001", "roadClass": "NATIONAL_HIGHWAY", "rightOfWayWidth": 25.5, "startPoint": { "type": "Point", "coordinates": [12.5, 45.2] } } ``` -------------------------------- ### EVChargingStation NGSI-LD Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/EVChargingStation/doc/spec.md This JSON-LD example represents an EVChargingStation entity normalized for NGSI-LD compatibility. It includes details about the station's location, capacity, charging type, and operational status. This format is suitable for direct use with NGSI-LD when context data is not explicitly managed. ```json { "id": "urn:ngsi-ld:EVChargingStation:ValladolI+D_Covaresa", "type": "EVChargingStation", "address": { "type": "Property", "value": { "addressCountry": "Espa\u00f1a", "addressLocality": "Valladolid", "streetAddress": "Paseo de Zorrilla, 191" } }, "allowedVehicleType": { "type": "Property", "value": [ "car" ] }, "capacity": { "type": "Property", "value": 2 }, "chargeType": { "type": "Property", "value": [ "free" ] }, "contactPoint": { "type": "Property", "value": { "email": "vehiculoelectrico@ava.es" } }, "location": { "type": "GeoProperty", "value": { "coordinates": [ -4.747901, 41.618265 ], "type": "Point" } }, "name": { "type": "Property", "value": "Agencia de Innovaci\u00f3n" }, "operator": { "type": "Property", "value": "Iberdrola" }, "socketType": { "type": "Property", "value": [ "Wall_Euro" ] }, "source": { "type": "Property", "value": "https://openchargemap.org/" }, "powerConsumption": { "type": "Property", "value": 10.0 }, "chargingUnitId": { "type": "Property", "value": "PZEV01-DeltaBharatAC001-SCTLGandhiPark001" }, "transactionId": { "type": "Property", "value": "84068784" }, "transactionType": { "type": "Property", "value": "RFID" }, "stationName": { "type": "Property", "value": "SmartCityTvmGandhiParkOne" }, "amountCollected": { "type": "Property", "value": 0.08 }, "taxAmountCollected": { "type": "Property", "value": 0.0 }, "endDateTime": { "type": "Property", "value": { "@type": "DateTime", "@value": "2022-06-28T20:28:41+05:30" } }, "startDateTime": { "type": "Property", "value": { "@type": "DateTime", "@value": "2022-06-28T20:27:27+05:30" } }, "vehicleType": { "type": "Property", "value": "e-motorcycle" }, "observationDateTime": { "type": "Property", "value": { "@type": "DateTime", "@value": "2022-06-28T20:27:29+05:30" } }, "@context": [ "https://smart-data-models.github.io/dataModel.Transportation/context.jsonld" ] } ``` -------------------------------- ### Work Disposition Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/CityWork/doc/spec_ZH.md Illustrates different types of work dispositions that can impact traffic, such as lane reductions, sidewalk closures, and speed limit changes. It includes start and end dates, and days of the week affected. ```json { "disposition": "laneReduction", "startDate": "2020-05-11T08:00:00Z", "endDate": "2020-05-15T18:30:00Z", "dayOfWeek": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ], "comment": "Switching from 2 lanes to 1 lane - BusCorridor not available" } ``` ```json { "disposition": "sidewalkReduction", "startDate": "2020-05-12T00:00:00Z", "endDate": "2020-05-14T24:00:00Z", "dayOfWeek": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] } ``` -------------------------------- ### TrafficViolation NGSI-LD normalized Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/TrafficViolation/doc/spec.md An example of a TrafficViolation entity in NGSI-LD normalized format. ```APIDOC ## TrafficViolation NGSI-LD Normalized Example ### Description This example shows a TrafficViolation entity in NGSI-LD format, using the normalized structure. This is the default representation when `keyValues` is not specified. ### Method N/A (Example Data) ### Endpoint N/A (Example Data) ### Request Body ```json { "id": "ngsi-ld:Trafficviolation:234R:0212", "type": "TrafficViolation", "amountCollected": { "type": "Property", "value": 10500 }, "equipmentId": { "type": "Property", "value": "4" }, "equipmentType": { "type": "Property", "value": "Camera" }, "mediaURL": { "type": "Property", "value": "https://www.google.com/" }, "observationDateTime": { "type": "Property", "value": { "@type": "DateTime", "@value": "2021-03-11T15:51:02+05:30" } }, "paymentStatus": { "type": "Property", "value": "Paid" }, "reportId": { "type": "Property", "value": "182" }, "titleCode": { "type": "Property", "value": "11" }, "@context": [ "https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/context.jsonld" ] } ``` ### Response #### Success Response (200) N/A (Example Data) #### Response Example ```json { "id": "ngsi-ld:Trafficviolation:234R:0212", "type": "TrafficViolation", "amountCollected": { "type": "Property", "value": 10500 }, "equipmentId": { "type": "Property", "value": "4" }, "equipmentType": { "type": "Property", "value": "Camera" }, "mediaURL": { "type": "Property", "value": "https://www.google.com/" }, "observationDateTime": { "type": "Property", "value": { "@type": "DateTime", "@value": "2021-03-11T15:51:02+05:30" } }, "paymentStatus": { "type": "Property", "value": "Paid" }, "reportId": { "type": "Property", "value": "182" }, "titleCode": { "type": "Property", "value": "11" }, "@context": [ "https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/context.jsonld" ] } ``` ``` -------------------------------- ### Implement EVChargingStation Data Model in Python Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/EVChargingStation/code/README.md This script demonstrates how to instantiate and utilize the EVChargingStation data model. It serves as a reference for developers to integrate the model into their transportation data processing pipelines. ```python # Example usage of EVChargingStation data model from smart_data_models import EVChargingStation # Initialize the model station = EVChargingStation( id="urn:ngsi-ld:EVChargingStation:001", name="Central Station", location={"type": "Point", "coordinates": [13.4, 52.5]} ) print(f"Station initialized: {station.name}") ``` -------------------------------- ### TrafficViolation NGSI-LD key-values Example Source: https://github.com/smart-data-models/datamodel.transportation/blob/master/TrafficViolation/doc/spec.md An example of a TrafficViolation entity in NGSI-LD key-values format. ```APIDOC ## TrafficViolation NGSI-LD Key-Values Example ### Description This example demonstrates a TrafficViolation entity in NGSI-LD format, using the `keyValues` option. It includes the `@context` for proper interpretation. ### Method N/A (Example Data) ### Endpoint N/A (Example Data) ### Request Body ```json { "id": "ngsi-ld:Trafficviolation:234R:0212", "type": "TrafficViolation", "amountCollected": 10500, "equipmentId": "4", "equipmentType": "Camera", "mediaURL": "https://www.google.com/", "observationDateTime": "2021-03-11T15:51:02+05:30", "paymentStatus": "Paid", "reportId": "182", "titleCode": "11", "@context": [ "https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/context.jsonld" ] } ``` ### Response #### Success Response (200) N/A (Example Data) #### Response Example ```json { "id": "ngsi-ld:Trafficviolation:234R:0212", "type": "TrafficViolation", "amountCollected": 10500, "equipmentId": "4", "equipmentType": "Camera", "mediaURL": "https://www.google.com/", "observationDateTime": "2021-03-11T15:51:02+05:30", "paymentStatus": "Paid", "reportId": "182", "titleCode": "11", "@context": [ "https://raw.githubusercontent.com/smart-data-models/dataModel.Transportation/master/context.jsonld" ] } ``` ```