Skip to content

Commit

Permalink
Update exercise5.jv
Browse files Browse the repository at this point in the history
  • Loading branch information
CarstenSchmotz committed Jul 5, 2023
1 parent 51c9714 commit d857ed7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions exercises/exercise5.jv
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ pipeline GTFSPipeline {
//stop_name must maintain german umlauts
block GTFSTextFileInterpreter oftype TextFileInterpreter {encoding: "ASCII";}
block GTFSCSVInterpreter oftype CSVInterpreter {
enclosing: '"';
enclosingEscape: '"';
//enclosing: '"';
//enclosingEscape: '"';
delimiter: ",";
enclosing: '"';
}


//stop_lat/stop_lon must be a geographic coordinates between -90 and 90, including upper/lower bounds
valuetype Coordinates oftype decimal{ constraints: [Angleconstraint]; }
constraint Angleconstraint oftype RangeConstraint{ lowerBound: -90; upperBound: 90; }

valuetype Coordinates oftype decimal{ constraints: [Angleconstraint]; }

//Only keep stops from zone 2001
valuetype zone_id oftype integer{ constraints:[only2001];}
constraint only2001 oftype RangeConstraint { lowerBound: 2001; upperBound: 2001; }

valuetype zone_id oftype integer{ constraints:[only2001];}

//Use fitting SQLite types (e.g., BIGINT, TEXT or FLOAT) for all columns & Drop rows containing invalid data
//stop_name must be a text
Expand All @@ -46,14 +46,14 @@ pipeline GTFSPipeline {
"stop_name" oftype text,
"stop_lat" oftype Coordinates,
"stop_lon" oftype Coordinates,
"zone_id" oftype integer,
"zone_id" oftype zone_id,

];
}

//Write data into a SQLite database called “gtfs.sqlite”, in the table “stops”
block GTFSLoader oftype SQLiteLoader {
table: "stops";
file: "./gtfs.sqlite";
file: "gtfs.sqlite";
}
}

0 comments on commit d857ed7

Please sign in to comment.