GtfsTrip
This repository is now archived and subsequent works will be carried out the in Smart data models repositories.
Description
See https://developers.google.com/transit/gtfs/reference/#tripstxt
Data Model
The data model is defined as shown below:
-
id
: Entity ID.- It shall be
urn:ngsi-ld:GtfsTrip:<trip_identifier>
beingtrip_identifier
a value that can be derived from GTFStrip_id
.
- It shall be
-
type
: Entity type.- It shall be equal to
GtfsTrip
.
- It shall be equal to
-
source
: A sequence of characters giving the source of the entity data. -
dataProvider
: Specifies the URL to information about the provider of this information- Attribute type: Property. URL
- Optional
-
dateCreated
: Entity's creation timestamp.- Attribute type: Property. DateTime
- Read-Only. Automatically generated.
-
dateModified
: Last update timestamp of this Entity.- Attribute type: Property. DateTime
- Read-Only. Automatically generated.
-
headSign
: Same as GTFStrip_headsign
.- Attribute type: Property. Text.
- Optional
-
shortName
: Same as GTFStrip_short_name
.- Attribute type: Property. Text.
- Optional
-
direction
: Same as GTFSdirection_id
.- Attribute type: Property. Number.
- Allowed Values:
0
and1
as per GTFSdirection_id
. - Optional
-
block
: Same as GTFSblock_id
.- Attribute type: Property. Text
- Optional
-
hasService
: Same as GTFSservice_id
.- Attribute type: Relationship. It shall point to an Entity of Type GtfsService
- Mandatory
-
hasShape
: Same as GTFSshape_id
.- Attribute type: Relationship. It shall point to an Entity of Type GtfsShape
- Optional
-
hasRoute
: Same asroute_id
.- Attribute type: Relationship. It shall point to an Entity of Type GtfsRoute
- Mandatory
-
wheelChairAccessible
: Same as GTFSwheelchair_accessible
. -
bikesAllowed
: Same as GTFSbikes_allowed
.
Examples
Normalized Example
Normalized NGSI response
{
"id": "urn:ngsi-ld:GtfsTrip:Spain:Malaga:1",
"type": "GtfsTrip",
"direction": {
"value": 0
},
"headSign": {
"value": "San Andr\u00e9s"
},
"hasRoute": {
"type": "Relationship",
"value": "urn:ngsi-ld:GtfsRoute:Spain:Malaga:1"
},
"hasService": {
"type": "Relationship",
"value": "urn:ngsi-ld:GtfsService:Malaga_LAB"
},
"hasShape": {
"type": "Relationship",
"value": "urn:ngsi-ld:GtfsShape:Shape01"
}
}
key-value pairs Example
Sample uses simplified representation for data consumers ?options=keyValues
{
"id": "urn:ngsi-ld:GtfsTrip:Spain:Malaga:1",
"type": "GtfsTrip",
"hasService": "urn:ngsi-ld:GtfsService:Malaga_LAB",
"headSign": "San Andrés",
"direction": "0",
"hasRoute": "urn:ngsi-ld:gtfs:Route:Spain:Malaga:1",
"hasShape": "urn:ngsi-ld:GtfsShape:Shape01"
}
LD Example
Sample uses the NGSI-LD representation
{
"id": "urn:ngsi-ld:GtfsTrip:Spain:Malaga:1",
"type": "GtfsTrip",
"direction": {
"type": "Property",
"value": 0
},
"headSign": {
"type": "Property",
"value": "San Andr\u00e9s"
},
"hasRoute": {
"type": "Relationship",
"object": "urn:ngsi-ld:GtfsRoute:Spain:Malaga:1"
},
"hasService": {
"type": "Relationship",
"object": "urn:ngsi-ld:GtfsService:Malaga_LAB"
},
"hasShape": {
"type": "Relationship",
"object": "urn:ngsi-ld:GtfsShape:Shape01"
},
"@context": [
"https://schema.lab.fiware.org/ld/context",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
]
}
Summary of mappings to GTFS
Properties
GTFS Field | NGSI Attribute | LinkedGTFS | Comment |
---|---|---|---|
trip_headsign |
headSign |
gtfs:headsign |
|
trip_short_name |
shortName |
gtfs:shortName |
|
direction_id |
direction |
gtfs:direction |
|
block_id |
block |
gtfs:block |
|
wheelchair_accessible |
wheelchairAccessible |
gtfs:wheelchairAccessible |
|
bikes_allowed |
bikesAllowed |
gtfs:bikesAllowed |
Relationships
GTFS Field | NGSI Attribute | LinkedGTFS | Comment |
---|---|---|---|
route_id |
hasRoute |
||
service_id |
hasService |
gtfs:service |
It shall point to an Entity of Type GtfsService |
shape_id |
hasShape |
gtfs:shape |
It shall point to an Entity of Type GtfsShape |