Skip to content

Commit

Permalink
Exercise 2 for badge
Browse files Browse the repository at this point in the history
  • Loading branch information
Farrukh14 committed Jul 7, 2024
1 parent 28332d5 commit a2344e8
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions exercises/exercise2.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
pipeline AutomatedPipeline

{

CSVExtractor -> TextFileInterpretation ;
TextFileInterpretation-> CSVInterpretation ;
CSVInterpretation
-> columndeletion
-> TableInterpretion
-> TreesLoader;

block CSVExtractor oftype HttpExtractor{
url:
"https://opendata.rhein-kreis-neuss.de/api/v2/catalog/datasets/stadt-neuss-herbstpflanzung-2023/exports/csv";
}

block TextFileInterpretation oftype TextFileInterpreter { }

block CSVInterpretation oftype CSVInterpreter{

delimiter: ';';

}

constraint Geo_constraint oftype RegexConstraint
{
regex: /^\d{1,3}\.\d+,\s\d{1,3}\.\d+$/;
}
valuetype GEO oftype text
{
constraints: [Geo_constraint];
}

valuetype StadtFurth oftype text{
constraints:[FurthCity];
}

constraint FurthCity oftype AllowlistConstraint{
allowlist:["Furth-Süd", "Furth-Mitte", "Furth-Nord"];
}

block columndeletion oftype ColumnDeleter{
delete: [column E];
}

block TableInterpretion oftype TableInterpreter
{
header: false;
columns: [
"lfd_nr" oftype integer,
"stadtteil" oftype StadtFurth,
"standort" oftype text,
"baumart_botanisch" oftype text,
"baumart_deutsch" oftype text,
"id" oftype GEO,
"baumfamilie" oftype text
];
}

block TreesLoader oftype SQLiteLoader {
table: "trees";
file: "./trees.sqlite";

}



}

0 comments on commit a2344e8

Please sign in to comment.