<commit_before>Station
-------

    +--------+-------------+------+-----+---------+-------+
    | Field  | Type        | Null | Key | Default | Extra |
    +--------+-------------+------+-----+---------+-------+
    | ID     | varchar(5)  | NO   | PRI |         |       |
    | Name   | varchar(40) | NO   |     | NULL    |       |
    | EVA_ID | int(11)     | NO   |     | NULL    |       |
    +--------+-------------+------+-----+---------+-------+

Trains
------

    +------------+--------------+------+-----+---------+-------+
    | Field      | Type         | Null | Key | Default | Extra |
    +------------+--------------+------+-----+---------+-------+
    | station_id | varchar(5)   | YES  |     | NULL    |       |
    | track_id   | varchar(4)   | YES  |     | NULL    |       |
    | type       | varchar(4)   | YES  |     | NULL    |       |
    | number     | int(11)      | YES  |     | NULL    |       |
    | name       | varchar(8)   | YES  |     | NULL    |       |
    | starttime  | time         | YES  |     | NULL    |       |
    | sections   | varchar(10)  | YES  |     | NULL    |       |
    | addtext    | varchar(256) | YES  |     | NULL    |       |
    +------------+--------------+------+-----+---------+-------+

Waggons
-------

    +----------------+--------------+------+-----+---------+-------+
    | Field          | Type         | Null | Key | Default | Extra |
    +----------------+--------------+------+-----+---------+-------+
    | station_id     | varchar(5)   | YES  |     | NULL    |       |
    | track_id       | varchar(4)   | YES  |     | NULL    |       |
    | traintype      | varchar(4)   | YES  |     | NULL    |       |
    | trainnumber    | int(11)      | YES  |     | NULL    |       |
    | trainname      | varchar(8)   | YES  |     | NULL    |       |
    | starttime      | time         | YES  |     | NULL    |       |
    | waggonname     | int(11)      | YES  |     | NULL    |       |
    | waggonsections | varchar(10)  | YES  |     | NULL    |       |
    | addtext        | varchar(256) | YES  |     | NULL    |       |
    | waggonposition | int(11)      | YES  |     | NULL    |       |
    | waggontype     | varchar(5)   | YES  |     | NULL    |       |
    | waggonsymbols  | varchar(10)  | YES  |     | NULL    |       |
    +----------------+--------------+------+-----+---------+-------+<commit_msg>write an readme for importing data<commit_after># How to get data in to database
## Create a mysql database and a user

```mysql
CREATE DATABASE WoIstDerWagen
CREATE USER 'WoIstDerWagen'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON 'WoIstDerWagen' . * TO 'WoIstDerWagen'@'localhost';
FLUSH PRIVILEGES;
```

## Download data from OpenDataPortal and unzip it

```bash
wget http://download-data.deutschebahn.com/static/datasets/wagenstand/Wagenreihungsplan_RawData_20160617.zip
unzip Wagenreihungsplan_RawData_20160617.zip
```

## Import data to database

```bash
./stations2mysql.rb localhost WoIstDerWagen password <PASSWORD>
./trains2mysql.rb localhost WoIstDerWagen password <PASSWORD>
```

(Please not that it is not relay good that we transport the database password in the command line, so perhabs do this on your development machine and afterwards do a database dump and put it to your productional machine)

## TODO

Indexes and references on the database

## Weblinks

http://data.deutschebahn.com/dataset/data-wagenreihungsplan-soll-daten
{'fraction_non_alphanumeric': 0.25261324041811845, 'fraction_numerical': 0.015098722415795587, 'mean_word_length': 1.1450809464508094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2070821', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1059, 'n_words': 227}