Skip to content

Commit

Permalink
sort alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
sannegovaert committed Jun 24, 2024
1 parent 1fec6bd commit 329de2d
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 159 deletions.
162 changes: 81 additions & 81 deletions sql/dwc_occurrence.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,115 +17,115 @@ SELECT

-- TAXON
CASE
WHEN o."ScientificName" = 'Rutilus Rutilus' THEN 'Rutilus rutilus'
WHEN o."ScientificName" = 'Scardinius erythrophthalmus' THEN 'Scardinius erythrophthalmus'
WHEN o."ScientificName" = 'Abramis bjoerkna' THEN 'Abramis bjoerkna'
WHEN o."ScientificName" = 'Tinca tinca' THEN 'Tinca tinca'
WHEN o."ScientificName" = 'Esox lucius' THEN 'Esox lucius'
WHEN o."ScientificName" = 'Abramis Brama' THEN 'Abramis brama'
WHEN o."ScientificName" = 'Perca fluviatilis' THEN 'Perca fluviatilis'
WHEN o."ScientificName" = 'Gasterosteus aculeatus' THEN 'Gasterosteus aculeatus'
WHEN o."ScientificName" = 'Pungitius pungitius' THEN 'Pungitius pungitius'
WHEN o."ScientificName" = 'Carassius auratus gibelio' THEN 'Carassius auratus gibelio'
WHEN o."ScientificName" = 'Cyprinus carpio' THEN 'Cyprinus carpio'
WHEN o."ScientificName" = 'Gobio gobio' THEN 'Gobio gobio'
WHEN o."ScientificName" = 'Alburnus alburnus' THEN 'Alburnus alburnus'
WHEN o."ScientificName" = 'Ameiurus nebulosus' THEN 'Ameiurus nebulosus'
WHEN o."ScientificName" = 'Anarhichas lupus' THEN 'Anarhichas lupus'
WHEN o."ScientificName" = 'Aspius aspius' THEN 'Aspius aspius'
WHEN o."ScientificName" = 'Barbatula barbatulus' THEN 'Barbatula barbatulus'
WHEN o."ScientificName" = 'Blicca bjoerkna' THEN 'Blicca bjoerkna'
WHEN o."ScientificName" = 'Carassius auratus auratus' THEN 'Carassius auratus auratus'
WHEN o."ScientificName" = 'Pseudorasbora parva' THEN 'Pseudorasbora parva'
WHEN o."ScientificName" = 'Oncorhynchus mykiss' THEN 'Oncorhynchus mykiss'
WHEN o."ScientificName" = 'Pimephales promelas' THEN 'Pimephales promelas'
WHEN o."ScientificName" = 'Gymnocephalus cernua' THEN 'Gymnocephalus cernua'
WHEN o."ScientificName" = 'Neogobius melanostomus' THEN 'Neogobius melanostomus'
WHEN o."ScientificName" = 'Stizostedion lucoperca' THEN 'Stizostedion lucoperca'
WHEN o."ScientificName" = 'Lepomis gibbosus' THEN 'Lepomis gibbosus'
WHEN o."ScientificName" = 'Solea solea' THEN 'Solea solea'
WHEN o."ScientificName" = 'Carassius auratus gibelio' THEN 'Carassius auratus gibelio'
WHEN o."ScientificName" = 'Carassius carassius' THEN 'Carassius carassius'
WHEN o."ScientificName" = 'Ctenopharyngodon idella' THEN 'Ctenopharyngodon idella'
WHEN o."ScientificName" = 'Hypophthalmichthys molitrix' THEN 'Hypophthalmichthys molitrix'
WHEN o."ScientificName" = 'Ctenopharyngodon idellia' THEN 'Ctenopharyngodon idellia'
WHEN o."ScientificName" = 'Cyprinus carpio' THEN 'Cyprinus carpio'
WHEN o."ScientificName" = 'Dicentrarchus labrax' THEN 'Dicentrarchus labrax'
WHEN o."ScientificName" = 'Procambarus clarkii' THEN 'Procambarus clarkii'
WHEN o."ScientificName" = 'Eriocheir sinensis' THEN 'Eriocheir sinensis'
WHEN o."ScientificName" = 'Pleuronectes platessa' THEN 'Pleuronectes platessa'
WHEN o."ScientificName" = 'Pomatoschistus minutus' THEN 'Pomatoschistus minutus'
WHEN o."ScientificName" = 'Aspius aspius' THEN 'Aspius aspius'
WHEN o."ScientificName" = 'Esox lucius' THEN 'Esox lucius'
WHEN o."ScientificName" = 'Faxonius limosus' THEN 'Faxonius limosus'
WHEN o."ScientificName" = 'Lithobates catesbeianus' THEN 'Lithobates catesbeianus'
WHEN o."ScientificName" = 'Anarhichas lupus' THEN 'Anarhichas lupus'
WHEN o."ScientificName" = 'Leuciscus rutilus' THEN 'Leuciscus rutilus'
WHEN o."ScientificName" = 'Rutilus erythrophthalmus' THEN 'Rutilus erythrophthalmus'
WHEN o."ScientificName" = 'Blicca bjoerkna' THEN 'Blicca bjoerkna'
WHEN o."ScientificName" = 'Gasterosteus aculeatus' THEN 'Gasterosteus aculeatus'
WHEN o."ScientificName" = 'Gobio gobio' THEN 'Gobio gobio'
WHEN o."ScientificName" = 'Gymnocephalus cernua' THEN 'Gymnocephalus cernua'
WHEN o."ScientificName" = 'Gymnocephalus cernuus' THEN 'Gymnocephalus cernuus'
WHEN o."ScientificName" = 'Stizostedion lucioperca' THEN 'Stizostedion lucioperca'
WHEN o."ScientificName" = 'Platichthys flesus' THEN 'Platichthys flesus'
WHEN o."ScientificName" = 'Ctenopharyngodon idellia' THEN 'Ctenopharyngodon idellia'
WHEN o."ScientificName" = 'Sprattus sprattus' THEN 'Sprattus sprattus'
WHEN o."ScientificName" = 'Trisopterus luscus' THEN 'Trisopterus luscus'
WHEN o."ScientificName" = 'Umbra Pygmaea' THEN 'Umbra pygmaea'
WHEN o."ScientificName" = 'Hypophthalmichthys molitrix' THEN 'Hypophthalmichthys molitrix'
WHEN o."ScientificName" = 'Lepomis gibbosus' THEN 'Lepomis gibbosus'
WHEN o."ScientificName" = 'Leucaspius delineatus' THEN 'Leucaspius delineatus'
WHEN o."ScientificName" = 'Barbatula barbatulus' THEN 'Barbatula barbatulus'
WHEN o."ScientificName" = 'Leuciscus leuciscus' THEN 'Leuciscus leuciscus'
WHEN o."ScientificName" = 'Leuciscus cephalus' THEN 'Leuciscus cephalus'
WHEN o."ScientificName" = 'Leuciscus idus' THEN 'Leuciscus idus'
WHEN o."ScientificName" = 'Alburnus alburnus' THEN 'Alburnus alburnus'
WHEN o."ScientificName" = 'Rhodeus sericeus' THEN 'Rhodeus sericeus'
WHEN o."ScientificName" = 'Pomatoschistus microps' THEN 'Pomatoschistus microps'
WHEN o."ScientificName" = 'Osmerus eperlanus' THEN 'Osmerus eperlanus'
WHEN o."ScientificName" = 'Ameiurus nebulosus' THEN 'Ameiurus nebulosus'
WHEN o."ScientificName" = 'Leuciscus leuciscus' THEN 'Leuciscus leuciscus'
WHEN o."ScientificName" = 'Leuciscus rutilus' THEN 'Leuciscus rutilus'
WHEN o."ScientificName" = 'Lithobates catesbeianus' THEN 'Lithobates catesbeianus'
WHEN o."ScientificName" = 'Liza ramada' THEN 'Liza ramada'
WHEN o."ScientificName" = 'Neogobius melanostomus' THEN 'Neogobius melanostomus'
WHEN o."ScientificName" = 'Oncorhynchus mykiss' THEN 'Oncorhynchus mykiss'
WHEN o."ScientificName" = 'Osmerus eperlanus' THEN 'Osmerus eperlanus'
WHEN o."ScientificName" = 'Perca fluviatilis' THEN 'Perca fluviatilis'
WHEN o."ScientificName" = 'Pimephales promelas' THEN 'Pimephales promelas'
WHEN o."ScientificName" = 'Platichthys flesus' THEN 'Platichthys flesus'
WHEN o."ScientificName" = 'Pleuronectes platessa' THEN 'Pleuronectes platessa'
WHEN o."ScientificName" = 'Pomatoschistus microps' THEN 'Pomatoschistus microps'
WHEN o."ScientificName" = 'Pomatoschistus minutus' THEN 'Pomatoschistus minutus'
WHEN o."ScientificName" = 'Procambarus clarkii' THEN 'Procambarus clarkii'
WHEN o."ScientificName" = 'Pseudorasbora parva' THEN 'Pseudorasbora parva'
WHEN o."ScientificName" = 'Pungitius pungitius' THEN 'Pungitius pungitius'
WHEN o."ScientificName" = 'Rhodeus sericeus' THEN 'Rhodeus sericeus'
WHEN o."ScientificName" = 'Rutilus erythrophthalmus' THEN 'Rutilus erythrophthalmus'
WHEN o."ScientificName" = 'Rutilus Rutilus' THEN 'Rutilus rutilus'
WHEN o."ScientificName" = 'Scardinius erythrophthalmus' THEN 'Scardinius erythrophthalmus'
WHEN o."ScientificName" = 'Solea solea' THEN 'Solea solea'
WHEN o."ScientificName" = 'Sprattus sprattus' THEN 'Sprattus sprattus'
WHEN o."ScientificName" = 'Stizostedion lucioperca' THEN 'Stizostedion lucioperca'
WHEN o."ScientificName" = 'Stizostedion lucoperca' THEN 'Stizostedion lucoperca'
WHEN o."ScientificName" = 'Tinca tinca' THEN 'Tinca tinca'
WHEN o."ScientificName" = 'Trisopterus luscus' THEN 'Trisopterus luscus'
WHEN o."ScientificName" = 'Umbra Pygmaea' THEN 'Umbra pygmaea'
ELSE NULL
END AS scientificName,
o."Kingdom" AS kingdom, -- Animalia
CASE
WHEN o.DutchName = 'Blankvoorn' THEN 'blankvoorn'
WHEN o.DutchName = 'rietvoorn' THEN 'rietvoorn'
WHEN o.DutchName = 'kolblei' THEN 'kolblei'
WHEN o.DutchName = 'zeelt' THEN 'zeelt'
WHEN o.DutchName = 'snoek' THEN 'snoek'
WHEN o.DutchName = 'brasem' THEN 'brasem'
WHEN o.DutchName = 'Baars' THEN 'baars'
WHEN o.DutchName = '3-doornige stekelbaars' THEN 'driedoornige stekelbaars'
WHEN o.DutchName = '10-doornige stekelbaars' THEN 'tiendoornige stekelbaars'
WHEN o.DutchName = 'Giebel' THEN 'giebel'
WHEN o.DutchName = 'Karper' THEN 'karper'
WHEN o.DutchName = 'riviergrondel' THEN 'riviergrondel'
WHEN o.DutchName = 'Goudvis' THEN 'goudvis'
WHEN o.DutchName = 'Alver' THEN 'alver'
WHEN o.DutchName = 'Amerikaanse hondsvis' THEN 'Amerikaanse hondsvis'
WHEN o.DutchName = 'Amerikaanse stierkikker' THEN 'Amerikaanse stierkikker'
WHEN o.DutchName = 'Baars' THEN 'baars'
WHEN o.DutchName = 'bermpje' THEN 'bermpje'
WHEN o.DutchName = 'Bittervoorn' THEN 'bittervoorn'
WHEN o.DutchName = 'Blankvoorn' THEN 'blankvoorn'
WHEN o.DutchName = 'Blauwbandgrondel' THEN 'blauwbandgrondel'
WHEN o.DutchName = 'regenboogforel' THEN 'regenboogforel'
WHEN o.DutchName = 'Bot' THEN 'bot'
WHEN o.DutchName = 'brakwatergrondel' THEN 'brakwatergrondel'
WHEN o.DutchName = 'brasem' THEN 'brasem'
WHEN o.DutchName = 'bruine Amerikaanse dwergmeerval' THEN 'bruine Amerikaanse dwergmeerval'
WHEN o.DutchName = 'Chinese wolhandkrab' THEN 'Chinese wolhandkrab'
WHEN o.DutchName = 'Dikkopelrits' THEN 'dikkopelrits'
WHEN o.DutchName = 'Pos' THEN 'pos'
WHEN o.DutchName = 'zwartbekgrondel' THEN 'zwartbekgrondel'
WHEN o.DutchName = 'snoekbaars' THEN 'snoekbaars'
WHEN o.DutchName = 'Snoekbaars' THEN 'snoekbaars'
WHEN o.DutchName = 'Zonnebaars' THEN 'zonnebaars'
WHEN o.DutchName = 'Tong' THEN 'tong'
WHEN o.DutchName = 'Kroeskarper' THEN 'kroeskarper'
WHEN o.DutchName = 'Dikkopje' THEN 'dikkopje'
WHEN o.DutchName = 'Dunlipharder' THEN 'dunlipharder'
WHEN o.DutchName = 'Europese meerval' THEN 'Europese meerval'
WHEN o.DutchName = 'Gevlekte Amerikaanse rivierkreeft' THEN 'gevlekte Amerikaanse rivierkreeft'
WHEN o.DutchName = 'Giebel' THEN 'giebel'
WHEN o.DutchName = 'Goudvis' THEN 'goudvis'
WHEN o.DutchName = 'Graskarper' THEN 'graskarper'
WHEN o.DutchName = 'Zilverkarper' THEN 'zilverkarper'
WHEN o.DutchName = 'zeebaars' THEN 'zeebaars'
WHEN o.DutchName = 'Zeebaars' THEN 'zeebaars'
WHEN o.DutchName = 'Karper' THEN 'karper'
WHEN o.DutchName = 'kolblei' THEN 'kolblei'
WHEN o.DutchName = 'kopvoorn' THEN 'kopvoorn'
WHEN o.DutchName = 'Kroeskarper' THEN 'kroeskarper'
WHEN o.DutchName = 'Pos' THEN 'pos'
WHEN o.DutchName = 'regenboogforel' THEN 'regenboogforel'
WHEN o.DutchName = 'rietvoorn' THEN 'rietvoorn'
WHEN o.DutchName = 'riviergrondel' THEN 'riviergrondel'
WHEN o.DutchName = 'Rode Amerikaanse rivierkreeft' THEN 'rode Amerikaanse rivierkreeft'
WHEN o.DutchName = 'Chinese wolhandkrab' THEN 'Chinese wolhandkrab'
WHEN o.DutchName = 'Schol' THEN 'schol'
WHEN o.DutchName = 'Dikkopje' THEN 'dikkopje'
WHEN o.DutchName = 'roofblei' THEN 'roofblei'
WHEN o.DutchName = 'Gevlekte Amerikaanse rivierkreeft' THEN 'gevlekte Amerikaanse rivierkreeft'
WHEN o.DutchName = 'Amerikaanse stierkikker' THEN 'Amerikaanse stierkikker'
WHEN o.DutchName = 'Europese meerval' THEN 'Europese meerval'
WHEN o.DutchName = 'Bot' THEN 'bot'
WHEN o.DutchName = 'Zeewolf' THEN 'zeewolf'
WHEN o.DutchName = 'Schol' THEN 'schol'
WHEN o.DutchName = 'serpeling' THEN 'serpeling'
WHEN o.DutchName = 'Snoekbaars' THEN 'snoekbaars'
WHEN o.DutchName = 'snoekbaars' THEN 'snoekbaars'
WHEN o.DutchName = 'snoek' THEN 'snoek'
WHEN o.DutchName = 'spiering' THEN 'spiering'
WHEN o.DutchName = 'Sprot' THEN 'sprot'
WHEN o.DutchName = 'Steenbolk' THEN 'steenbolk'
WHEN o.DutchName = 'Amerikaanse hondsvis' THEN 'Amerikaanse hondsvis'
WHEN o.DutchName = 'Tong' THEN 'tong'
WHEN o.DutchName = 'Vetje' THEN 'vetje'
WHEN o.DutchName = 'bermpje' THEN 'bermpje'
WHEN o.DutchName = 'serpeling' THEN 'serpeling'
WHEN o.DutchName = 'kopvoorn' THEN 'kopvoorn'
WHEN o.DutchName = 'winde' THEN 'winde'
WHEN o.DutchName = 'Alver' THEN 'alver'
WHEN o.DutchName = 'Bittervoorn' THEN 'bittervoorn'
WHEN o.DutchName = 'brakwatergrondel' THEN 'brakwatergrondel'
WHEN o.DutchName = 'spiering' THEN 'spiering'
WHEN o.DutchName = 'bruine Amerikaanse dwergmeerval' THEN 'bruine Amerikaanse dwergmeerval'
WHEN o.DutchName = 'Dunlipharder' THEN 'dunlipharder'
WHEN o.DutchName = 'Zeebaars' THEN 'zeebaars'
WHEN o.DutchName = 'zeebaars' THEN 'zeebaars'
WHEN o.DutchName = 'zeelt' THEN 'zeelt'
WHEN o.DutchName = 'Zeewolf' THEN 'zeewolf'
WHEN o.DutchName = 'Zilverkarper' THEN 'zilverkarper'
WHEN o.DutchName = 'Zonnebaars' THEN 'zonnebaars'
WHEN o.DutchName = 'zwartbekgrondel' THEN 'zwartbekgrondel'
ELSE NULL
END AS vernacularName
FROM occurrences AS o
156 changes: 78 additions & 78 deletions tests/test_dwc_event_occurrence_mof.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,60 +153,60 @@ testthat::test_that(

testthat::test_that("scientificName is never NA and one of the list", {
species <- c(
"Rutilus rutilus",
"Scardinius erythrophthalmus",
"Abramis bjoerkna",
"Tinca tinca",
"Esox lucius",
"Abramis brama",
"Perca fluviatilis",
"Gasterosteus aculeatus",
"Pungitius pungitius",
"Carassius auratus gibelio",
"Cyprinus carpio",
"Gobio gobio",
"Alburnus alburnus",
"Ameiurus nebulosus",
"Anarhichas lupus",
"Aspius aspius",
"Barbatula barbatulus",
"Blicca bjoerkna",
"Carassius auratus auratus",
"Pseudorasbora parva",
"Oncorhynchus mykiss",
"Pimephales promelas",
"Gymnocephalus cernua",
"Neogobius melanostomus",
"Stizostedion lucoperca",
"Lepomis gibbosus",
"Solea solea",
"Carassius auratus gibelio",
"Carassius carassius",
"Ctenopharyngodon idella",
"Hypophthalmichthys molitrix",
"Ctenopharyngodon idellia",
"Cyprinus carpio",
"Dicentrarchus labrax",
"Procambarus clarkii",
"Eriocheir sinensis",
"Pleuronectes platessa",
"Pomatoschistus minutus",
"Aspius aspius",
"Esox lucius",
"Faxonius limosus",
"Lithobates catesbeianus",
"Anarhichas lupus",
"Leuciscus rutilus",
"Rutilus erythrophthalmus",
"Blicca bjoerkna",
"Gasterosteus aculeatus",
"Gobio gobio",
"Gymnocephalus cernua",
"Gymnocephalus cernuus",
"Stizostedion lucioperca",
"Platichthys flesus",
"Ctenopharyngodon idellia",
"Sprattus sprattus",
"Trisopterus luscus",
"Umbra pygmaea",
"Hypophthalmichthys molitrix",
"Lepomis gibbosus",
"Leucaspius delineatus",
"Barbatula barbatulus",
"Leuciscus leuciscus",
"Leuciscus cephalus",
"Leuciscus idus",
"Alburnus alburnus",
"Rhodeus sericeus",
"Pomatoschistus microps",
"Leuciscus leuciscus",
"Leuciscus rutilus",
"Lithobates catesbeianus",
"Liza ramada",
"Neogobius melanostomus",
"Oncorhynchus mykiss",
"Osmerus eperlanus",
"Ameiurus nebulosus",
"Liza ramada"
"Perca fluviatilis",
"Pimephales promelas",
"Platichthys flesus",
"Pleuronectes platessa",
"Pomatoschistus microps",
"Pomatoschistus minutus",
"Procambarus clarkii",
"Pseudorasbora parva",
"Pungitius pungitius",
"Rhodeus sericeus",
"Rutilus erythrophthalmus",
"Rutilus rutilus",
"Scardinius erythrophthalmus",
"Solea solea",
"Sprattus sprattus",
"Stizostedion lucioperca",
"Stizostedion lucoperca",
"Tinca tinca",
"Trisopterus luscus",
"Umbra pygmaea"
)
testthat::expect_true(all(!is.na(dwc_occurrence$scientificName)))
testthat::expect_true(all(dwc_occurrence$scientificName %in% species))
Expand All @@ -220,55 +220,55 @@ testthat::test_that("kingdom is always equal to Animalia", {
testthat::test_that(
"vernacularName is never NA and one of the list", {
vernacular_names <- c(
"alver",
"Amerikaanse hondsvis",
"Amerikaanse stierkikker",
"baars",
"bermpje",
"bittervoorn",
"blankvoorn",
"rietvoorn",
"kolblei",
"zeelt",
"snoek",
"blauwbandgrondel",
"bot",
"brakwatergrondel",
"brasem",
"baars",
"bruine Amerikaanse dwergmeerval",
"Chinese wolhandkrab",
"dikkopelrits",
"dikkopje",
"driedoornige stekelbaars",
"tiendoornige stekelbaars",
"dunlipharder",
"Europese meerval",
"gevlekte Amerikaanse rivierkreeft",
"giebel",
"karper",
"riviergrondel",
"goudvis",
"blauwbandgrondel",
"regenboogforel",
"dikkopelrits",
"pos",
"zwartbekgrondel",
"snoekbaars",
"zonnebaars",
"tong",
"kroeskarper",
"graskarper",
"zilverkarper",
"zeebaars",
"karper",
"kolblei",
"kopvoorn",
"kroeskarper",
"pos",
"regenboogforel",
"rietvoorn",
"riviergrondel",
"rode Amerikaanse rivierkreeft",
"Chinese wolhandkrab",
"schol",
"dikkopje",
"roofblei",
"gevlekte Amerikaanse rivierkreeft",
"Amerikaanse stierkikker",
"Europese meerval",
"bot",
"zeewolf",
"schol",
"serpeling",
"snoekbaars",
"snoek",
"spiering",
"sprot",
"steenbolk",
"Amerikaanse hondsvis",
"tiendoornige stekelbaars",
"tong",
"vetje",
"bermpje",
"serpeling",
"kopvoorn",
"winde",
"alver",
"bittervoorn",
"brakwatergrondel",
"spiering",
"bruine Amerikaanse dwergmeerval",
"dunlipharder"
"zeebaars",
"zeelt",
"zeewolf",
"zilverkarper",
"zonnebaars",
"zwartbekgrondel"
)
testthat::expect_true(
all(!is.na(dwc_occurrence$vernacularName))
Expand Down

0 comments on commit 329de2d

Please sign in to comment.