Skip to content

Commit

Permalink
Exercise 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Farrukh14 committed Jun 27, 2024
1 parent c24669a commit 6c73323
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions exercises/exercise5.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
pipeline GTFS{

httpExtractor -> file_selection-> text_transformer ->text_interpreter -> column_removal -> headers -> sql_db;

block httpExtractor oftype GTFSExtractor{
url:"https://gtfs.rhoenenergie-bus.de/GTFS.zip";
}



block file_selection oftype FilePicker{
path:"/stops.txt";
}


block text_transformer oftype TextFileInterpreter{
encoding: "utf8";
}

block text_interpreter oftype CSVInterpreter{
delimiter:",";
enclosing:'"';
}

block column_removal oftype ColumnDeleter {
delete: [column B, column D,column H, column I,column J, column K,column L];
}



block headers oftype TableInterpreter{
header: false;
columns:[
"stop_id" oftype integer,
"stop_name" oftype text,
"stop_lat" oftype GeoPointValue,
"stop_lon" oftype GeoPointValue,
"zone_id" oftype zoneValue
];
}

block sql_db oftype SQLiteLoader{
table:"stops";
file:"./gtfs.sqlite";
}

valuetype zoneValue oftype integer{
constraints:[
zoneSelector
];
}

constraint zoneSelector on integer:
value == 1645;


constraint GeoPoints oftype RangeConstraint {
lowerBound: -90;
upperBound: 90;
}
valuetype GeoPointValue oftype decimal {
constraints: [
GeoPoints
];
}


}

0 comments on commit 6c73323

Please sign in to comment.