The segment method
The data stored in the datawarehouse is stored using a railway model agnostic method. Every record in the datawarehouse will have a location and a time associated with it. The main problem with storing data for linear assets is that these linear assets change over time. For example when removing a switch two tracks might be merged or when inserting a switch a single track might be split. When merging or splitting a track, most of the track remains unchanged. However, all data previously coupled to this track is suddenly moved to a completely different location and must be relabeled.
Rather than relabeling all data, RailDB implements a segmentation method. Each edge of the railway network is split into short segments of approximately 1 meter in length. These segments receive a unique segment ID. When importing new data into the datawarehouse the data is not labeled with the current track ID because this might change over time. Instead the data is labeled with segment ID’s by using a mapping from the current track model to the segment model.
By applying this method, the stored data never has to be relabeled. Instead, for subsequent versions of the track model a new mapping from the new track model to the segment model is created. This principle is shown in the picture below. As you can see the segment model does not have any versions. It doesn’t need to.
Importing data
So how does importing data into the datawarehouse work? This process is shown here. Suppose that the data is labeled on track model version X. The mapping from track model X to segments is applied and the data is relabeled with segment ID’s. Next the data is imported into the datawarehouse.
Exporting data
Exporting the data works the other way around, the process is shown here. Suppose the data must be labeled on track model version X. The mapping for version X is then applied to relabel the data from segments to tracks. This can of course only be done for the segments that represent track that exists within version X of the track model. Next we take the data out of the datawarehouse.
Track model updates
When the track model is updated a new mapping must be created from the new track model to the segment model using a delta file. The delta file is a mapping between subsequent versions of a track model and is required to translate mapping version X to mapping version X+1. This process is shown here, consider the following scenarios for remapping the data:
- New tracks are added: new segments are added to the segment model. These segments will not be present in older mappings, but they will be in all newer mappings.
- Tracks are removed: the removed segments will not be present in the newer mappings any longer, but they will remain present in older mappings. So old data is never lost, it is just not accessible through newer versions of the track model any longer.
- Tracks are merged or split: in newer mappings the same segments from before will now simply reference different tracks. The great thing here is that due to the short segment lengths, the linear referencing of the data on the segments does not change. So again no relabeling of any data.