forked from jvalue/made-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise2.jv
80 lines (67 loc) · 1.96 KB
/
exercise2.jv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
pipeline BahnhofPipeline {
block BahnCSVExtractor oftype CSVExtractor{
url: "https://download-data.deutschebahn.com/static/datasets/haltestellen/D_Bahnhof_2020_alle.CSV";
delimiter: ";";
}
block BahnhofColumnDeleter oftype ColumnDeleter {
delete: [column J];
}
constraint VerkehrAllowedList on text:
value in [
"FV", "RV", "nur DPN",
];
valuetype verkehr oftype text {
constraints: [
VerkehrAllowedList,
];
}
constraint LaengeAndBreiteAllowedRange oftype RangeConstraint {
lowerBound: -90;
upperBound: 90;
}
valuetype laengeandbreite oftype decimal {
constraints: [
LaengeAndBreiteAllowedRange,
];
}
constraint IFOPTAllowedFormat oftype RegexConstraint {
regex: /\w{2}:\d*:\d*(?::\d*)?/;
}
valuetype ifopt oftype text {
constraints: [
IFOPTAllowedFormat,
];
}
constraint NonEmptyTextLength oftype LengthConstraint {
minLength: 1;
maxLength: 9007199254740991;
}
valuetype nonemptytext oftype text {
constraints: [
NonEmptyTextLength,
];
}
block BahnhofTableInterpreter oftype TableInterpreter {
header: true;
columns: [
"EVA_NR" oftype integer,
"DS100" oftype nonemptytext,
"IFOPT" oftype ifopt,
"NAME" oftype nonemptytext,
"Verkehr" oftype verkehr,
"Laenge" oftype laengeandbreite,
"Breite" oftype laengeandbreite,
"Betreiber_Name" oftype nonemptytext,
"Betreiber_Nr" oftype integer,
"Status" oftype nonemptytext
];
}
block BahnhofLoader oftype SQLiteLoader {
table: "trainstops";
file: "./trainstops.sqlite";
}
BahnCSVExtractor
-> BahnhofColumnDeleter
-> BahnhofTableInterpreter
-> BahnhofLoader;
}