Ara Import file
The Ara Import file can be used to feed a Ara SaaS referential via the Ara Import API.
- 1 File structure
- 2 General constraints
- 3 Operator
- 4 Stop Area
- 4.1 Example
- 5 Stop Area Groups
- 5.1 Example
- 6 Lines
- 6.1 Example
- 7 Line Groups
- 7.1 Example
- 8 Vehicle Journeys
- 8.1 Example
- 9 Stop Visits
- 10 Example
File structure
The file contains all element of the model repeated for each day we want to import. Each line starts with the element type.
As rows doesn’t have the same number of attributes, there are no headers.
Special syntax items
Comments are
#
.Separators are
,
Leading spaces are trimed
Quotes are escaped with another quote ex:
[""1234"",""5678""]
General constraints
All uuids must respect the postgresql uuid data type constraints.
All Hashes and Arrays are parsed as JSON objects and must respect the JSON syntax.
For all models, only the Type, Id, and ModelName attributes must be present. Other attributes can be left empty.
Operator
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ModelName | YYYY-MM-DD |
Name | String |
ObjectIDs | Hash |
Example
operator,a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,2017-01-01,Name,{"objectidKind":"operatorObjectid"}
Stop Area
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ParentId | UUID |
ReferentId | UUID |
ModelName | YYYY-MM-DD |
Name | String |
ObjectIDs | Hash |
LineIds | Array of UUID |
Attributes | Hash |
References | Hash |
CollectedAlways | boolean |
CollectChildren | boolean |
CollectSituations | boolean |
Example
stop_area,a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,c0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,2017-01-01,Name,{"objectidKind":"stopAreaObjectid"},"[""d0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"",""e0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11""]","{""AttributeKey"":""abcd""}","{""ReferenceType"":{""ObjectId"":{""objectidKind"":""5678""},""Id"":""42""}}",true,true,true
Stop Area Groups
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ModelName | YYYY-MM-DD |
Name | String |
ShortName | String |
StopAreaIds | Array of UUID |
Example
stop_area_group,a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,2017-01-01,Name,ShortName,"[""d0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"",""e0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11""]"
Lines
The 3 last attributes are optionnal, but you need to define them in the correct order. IE, the 8th attribute will always be CollectSituations, the 9th Number, and the 10th ReferentId.
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ModelName | YYYY-MM-DD |
Name | String |
ObjectIDs | Hash |
Attributes | Hash |
References | Hash |
CollectSituations | boolean |
Number | String |
ReferentId | UUID |
Example
Line Groups
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ModelName | YYYY-MM-DD |
Name | String |
ShortName | String |
LineIds | Array of UUID |
Example
Vehicle Journeys
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ModelName | YYYY-MM-DD |
Name | String |
ObjectIDs | Hash |
LineId | UUID |
OriginName | String |
DestinationName | String |
Attributes | Hash |
References | Hash |
DirectionType | String |
Example
Stop Visits
A stop visit schedule is a hash with the following keys:
Kind:
aimed
,expected
, oractual
DepartureTime: Time in ISO 8601 standard as a string (optional)
ArrivalTime: Time in ISO 8601 standard as a string (optional)
Attribute | Format |
---|---|
Type |
|
Id | UUID |
ModelName | YYYY-MM-DD |
ObjectIDs | Hash |
StopAreaId | UUID |
VehicleJourneyId | UUID |
PassageOrder | Int |
Schedules | Array of Hash |
Attributes | Hash |
References | Hash |
Example
Example
This file defines a Stop Area and a Line for five days: