How can I create and maintain logical links with third-party systems using Codes in Chouette?
When a user imports data, Chouette is able to collect all identifiers, whether in GTFS (attributes with *_id) or NeTEx (identifiers and Alternate Identifier).
These identifiers are strategic data for passenger information, as they make it possible to differentiate between similar elements in the transport offer production chain.
However, in many cases, it is not enough to store only the identifiers of data producers. Systems that feed on the schedule referential may use a similar or completely different identifier, so a solution must be found to link the original identifier to the internal identifier of each system.
Chouette SaaS allows you to create and store these logical links using several identifiers called Codes.
The storage and transmission of these identifiers or codes varies depending on the format:
GTFS: The format requires the transmission of one identifier per object.
NeTEx: All identifiers associated with an object can be transmitted.
This enrichment is made possible by the introduction of a new concept: a code space. This allows all codes to be stored in a separate, isolated space in order to store and feed one or more dedicated consumers. It is easy to imagine, for example, creating code spaces in a theoretical repository for:
ticketing
route calculators
open data
real time
etc.
The use of codes therefore allows a consumer to represent a facet of transport data that they are able to understand and integrate into their own system over time.
The intelligent and automated generation of these codes is possible via numerous macros based on UUIDs, sequences, information contained in the offer, etc.
Code creation
Before creating a code, the user must ensure that code spaces have been created at the Workgroup level:
To know more about Code Spaces, read the page https://enroute.atlassian.net/wiki/x/AwBLsg .
In Chouette, you can manually create a code for each model. To do this, enter the edit mode of the model, select a Code Space and enter the desired code.
You can also create codes automatically using macro lists:
https://enroute.atlassian.net/wiki/spaces/PUBLIC/pages/2011922433/Macro+lists#Create-a-code
https://enroute.atlassian.net/wiki/spaces/PUBLIC/pages/2011922433/Macro+lists#Create-Code-from-UUID
A few examples are available on this page: https://enroute.atlassian.net/wiki/x/E4A1t
Publishing data with codes
Chouette can use codes from a code space to publish data in NeTEx or GTFS by selecting the desired code space in the settings:
When a user publishes their data:
all models with a code in the selected code space will use this code as an identifier
all models without a code in the selected code space will use by default the registration number or the “external” code
for the NeTEx format, all codes will be visible in the KeyValue tags of type ALTERNATE_IDENTIFIER
<keyList>
<KeyValue typeOfKey="ALTERNATE_IDENTIFIER">
<Key>B22</Key>
<Value>3c932b84-d8d2-47b2-b171-93b8f096bbd0</Value>
</KeyValue>
<KeyValue typeOfKey="ALTERNATE_IDENTIFIER">
<Key>Qommute</Key>
<Value>34ee69d1-77a4-471b-b41d-efdce829b845</Value>
</KeyValue>
<KeyValue typeOfKey="ALTERNATE_IDENTIFIER">
<Key>B22</Key>
<Value>ed973ead-a49a-49d5-93fe-2de3a7f96ca0</Value>
</KeyValue>
<KeyValue typeOfKey="ALTERNATE_IDENTIFIER">
<Key>Qommute</Key>
<Value>9e1b534d-1573-46d8-b1e0-6fc43eb11421</Value>
</KeyValue>
<KeyValue typeOfKey="ALTERNATE_IDENTIFIER">
<Key>B22</Key>
<Value>a9052135-c723-474d-8522-fe782bff451e</Value>
</KeyValue>
</keyList>