Skip to content

Commit

Permalink
exercise 5 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozodbek47 committed Jan 23, 2024
1 parent 3da7f7b commit ee18f20
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions exercises/exercise5.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
pipeline GtfsPipeline {

GTFSSampleFeedExtractor -> ZipArchiveInterpreter;

ZipArchiveInterpreter
-> StopsFilePicker
-> StopsTextFileInterpreter
-> StopsCSVInterpreter
-> StopsColumnDeleter
-> StopsTableInterpreter
-> StopsLoader;

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

block ZipArchiveInterpreter oftype ArchiveInterpreter {
archiveType: "zip";
}

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

block StopsTextFileInterpreter oftype TextFileInterpreter { encoding: "latin2"; }
block StopsCSVInterpreter oftype CSVInterpreter { }

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

block StopsTableInterpreter oftype TableInterpreter {
header: true;
columns:[
"stop_id" oftype integer,
"stop_name" oftype text,
"stop_lat" oftype coordinatetype,
"stop_lon" oftype coordinatetype,
"zone_id" oftype zonetype
];
}

constraint GeographicCoordinate oftype RangeConstraint { lowerBound: -90; lowerBoundInclusive: true; upperBound: 90; upperBoundInclusive: true;}
valuetype coordinatetype oftype decimal { constraints: [ GeographicCoordinate ]; }

constraint allowedzone oftype AllowlistConstraint { allowlist: ['2001']; }
valuetype zonetype oftype integer { constraints: [ allowedzone ]; }

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

}

0 comments on commit ee18f20

Please sign in to comment.