forked from jvalue/made-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise4.jv
93 lines (75 loc) · 2.44 KB
/
exercise4.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
81
82
83
84
85
86
87
88
89
90
91
92
93
pipeline BatteryPipeline {
block BatteryExtractor oftype HttpExtractor {
url: "https://www.mowesta.com/data/measure/mowesta-dataset-20221107.zip";
}
block BatteryArchiveInterpreter oftype ArchiveInterpreter {
archiveType: "zip";
}
block BatteryFilePicker oftype FilePicker {
path: "/data.csv";
}
block BatteryFileInterpreter oftype TextFileInterpreter{
}
block BatteryCSVInterpreter oftype CSVInterpreter {
delimiter: ";";
}
block BatteryCoreDataSelector oftype CellRangeSelector {
select: range A1:K*;
}
block RenameTemperaturCellWriter oftype CellWriter {
at: cell E1;
write: ["Temperatur"];
}
block RenameTemperaturBatteryCellWriter oftype CellWriter {
at: cell J1;
write: ["Batterietemperatur"];
}
block BatterieTableInterpreter oftype TableInterpreter {
header: true;
columns: [
"Geraet" oftype ValidGeraetNumber,
"Hersteller" oftype text,
"Model" oftype text,
"Monat" oftype integer,
"Temperatur" oftype decimal,
"Batterietemperatur" oftype decimal,
"Geraet aktiv" oftype text,
];
}
transform CelsiusToFahrenheit {
from Celsius oftype decimal;
to Fahrenheit oftype decimal;
Fahrenheit: (Celsius * 1.8) + 32;
}
block CelsiusToFahrenheitTransformer oftype TableTransformer {
inputColumns: ['Temperatur'];
outputColumn: 'Temperatur';
use: CelsiusToFahrenheit;
}
block CelsiusToFahrenheitBatteryTransformer oftype TableTransformer {
inputColumns: ['Batterietemperatur'];
outputColumn: 'Batterietemperatur';
use: CelsiusToFahrenheit;
}
constraint ValidGeraetNumberRange on decimal:
value > 0;
valuetype ValidGeraetNumber oftype integer {
constraints: [ ValidGeraetNumberRange ];
}
block BatterieLoader oftype SQLiteLoader {
table: "temperatures";
file: "./temperatures.sqlite";
}
BatteryExtractor
-> BatteryArchiveInterpreter
-> BatteryFilePicker
-> BatteryFileInterpreter
-> BatteryCSVInterpreter
-> BatteryCoreDataSelector
-> RenameTemperaturCellWriter
-> RenameTemperaturBatteryCellWriter
-> BatterieTableInterpreter
-> CelsiusToFahrenheitTransformer
-> CelsiusToFahrenheitBatteryTransformer
-> BatterieLoader;
}