From 499a2690085a7608f3c8a9ff2d81d4a80890a6e8 Mon Sep 17 00:00:00 2001
From: Adri-Charbonneau <105881448+Adri-Charbonneau@users.noreply.github.com>
Date: Mon, 2 Oct 2023 14:28:36 +0200
Subject: [PATCH] =?UTF-8?q?Int=C3=A9gration=20de=20World=20Auchenorrhyncha?=
=?UTF-8?q?=20Database=20+=20correction=20de=20codes=20esp=C3=A8ces?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/PROCESSUS.yml | 6 ++---
BDD/WAD/index.html | 13 ++++++++++
CIGALES-CODES.csv | 6 ++---
SCRIPTS/CODES.ps1 | 46 +++++++++++++++++++++++++--------
4 files changed, 54 insertions(+), 17 deletions(-)
create mode 100644 BDD/WAD/index.html
diff --git a/.github/workflows/PROCESSUS.yml b/.github/workflows/PROCESSUS.yml
index 949c829b..8d104f12 100644
--- a/.github/workflows/PROCESSUS.yml
+++ b/.github/workflows/PROCESSUS.yml
@@ -5,11 +5,11 @@ on:
workflow_dispatch:
jobs:
- #CODES-ESPECE:
- # uses: ./.github/workflows/CODES.yml
+ CODES-ESPECE:
+ uses: ./.github/workflows/CODES.yml
TELECHARGEMENTS-BDD:
- # needs: CODES-ESPECE
+ needs: CODES-ESPECE
uses: ./.github/workflows/TELECHARGEMENTS.yml
secrets: inherit
diff --git a/BDD/WAD/index.html b/BDD/WAD/index.html
new file mode 100644
index 00000000..d07270e1
--- /dev/null
+++ b/BDD/WAD/index.html
@@ -0,0 +1,13 @@
+
+
+
+ Base de donnée - World Auchenorrhyncha Database
+
+
+
+
+
+
+ BASE DE DONNÉE - WORLD AUCHENORRHYNCHA DATABASE
+
+
\ No newline at end of file
diff --git a/CIGALES-CODES.csv b/CIGALES-CODES.csv
index dd715d25..12592167 100644
--- a/CIGALES-CODES.csv
+++ b/CIGALES-CODES.csv
@@ -8,11 +8,11 @@ Cicadetta_montana,Cicadetta montana,24474,51911,648932,362341,157059,9497766,V74
Cicadetta_petryi,Cicadetta petryi,47901,241097,6627,1257169,625104,4482650,V763,239540
Cicadetta_sibillae,Cicadetta sibillae,47928,892654,6638,1336954,1033881,8466776,5Z4R6,
Dimissalna_dimissa,Dimissalna dimissa,24501,701431,6689,552057,157082,7496589,3677T,
-Oligoglena_tibialis,Oligoglena tibialis,24478,241095,7236,1169252,625106,9362333,4966R,
+Oligoglena_tibialis,Oligoglena tibialis,24478,973119,7236,1169252,625106,9362333,4966R,
Tettigettalna_argentata,Tettigettalna argentata,24502,701438,7566,894951,822679,9182984,55V6C,
Tettigettula_pygmea,Tettigettula pygmea,24507,701435,7590,914822,822680,8057880,55V6R,
-Cicada_barbara,Cicada barbara,,,8749,362756,197570,10972541,V5G4,239481
-Cicada_barbara_lusitanica,Cicada barbara lusitanica,24452,,8751,362755,157031,4482720,8K2PQ,239482
+Cicada_barbara,Cicada barbara,24452,,8749,362756,197570,10972541,V5G4,239481
+Cicada_barbara_lusitanica,Cicada barbara lusitanica,,,8751,362755,157031,4482720,8K2PQ,239482
Cicada_orni,Cicada orni,24449,51913,8778,243961,157028,11104870,V629,239484
Cicadatra_atra,Cicadatra atra,24454,241091,8395,82825,157032,8638651,V6G4,239462
Graptopsaltria_nigrofuscata,Graptopsaltria nigrofuscata,24487,701762,11993,325363,552813,8357478,3HB9S,
diff --git a/SCRIPTS/CODES.ps1 b/SCRIPTS/CODES.ps1
index f37b263e..159774c9 100644
--- a/SCRIPTS/CODES.ps1
+++ b/SCRIPTS/CODES.ps1
@@ -6,7 +6,7 @@ $wad_erreurs = "WAD :"
$inat_erreurs = "iNaturalist :"
$obs_erreurs = "Observation :"
$gbif_erreurs = "GBIF :"
-$cof_erreurs = "COF :"
+$col_erreurs = "COL :"
$fe_erreurs = "Fauna-Europea :"
$cigales_codes | ForEach-Object {
@@ -23,7 +23,7 @@ $cigales_codes | ForEach-Object {
echo "Vérification de $nom"
- if ($code -eq "Oligoglena_tibialis") { $nom = "Cicadivetta tibialis" } # corrections taxonomiques entrée
+ if ($nom -eq "Oligoglena tibialis") { $nom = "Cicadivetta tibialis" } # corrections taxonomiques entrée
# FAUNE-FRANCE
if ($faune_france -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans Faune-France" }
@@ -43,6 +43,8 @@ $cigales_codes | ForEach-Object {
}
}
+ if ($nom -eq "Tibicina picta") { $nom = "Tibicina tomentosa" } # corrections taxonomiques entrée
+
# OBSERVATION
if ($observation -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans Observation.org" }
else {
@@ -75,6 +77,23 @@ $cigales_codes | ForEach-Object {
}
}
+ if ($nom -eq "Tibicina tomentosa") { $nom = "Tibicina picta" } # corrections taxonomiques sortie
+
+ # WAD - World Auchenorrhyncha Database
+ if ($wad -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans World Auchenorrhyncha Database" }
+ else {
+ $Sourcecode_json = (Invoke-WebRequest "https://sfg.taxonworks.org/api/v1/otus/$wad/inventory/taxonomy.json?project_token=ZEJhFp9sq8kBfks15qAbAg" | ConvertFrom-Json).name
+ $Sourcecode_json -match "(.*)<\/i>"
+ $Sourcecode = $matches[1]
+ if ($nom -eq $Sourcecode) { Write-Host " > Le code espèce de $nom dans World Auchenorrhyncha Database est "-NoNewline; Write-Host "correct" -ForegroundColor Green }
+ else {
+ Write-Host " > Le code espèce de $nom dans World Auchenorrhyncha Database est "-NoNewline; Write-Host "incorrect" -ForegroundColor Red
+ $wad_erreurs = $wad_erreurs + " " + $nom
+ $wad_erreurs > "./BDD/WAD/erreurs.txt"
+ }
+ }
+
+
# INATURALIST
if ($inaturalist -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans iNaturalist" }
else {
@@ -86,7 +105,7 @@ $cigales_codes | ForEach-Object {
$inat_erreurs = $inat_erreurs + " " + $nom
$inat_erreurs > "./BDD/INATURALIST/erreurs.txt"
}
- }
+ }
# GBIF
if ($gbif -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans GBIF" }
@@ -102,19 +121,17 @@ $cigales_codes | ForEach-Object {
}
# CATALOGUE OF LIFE
- if ($code -eq "Tibicina_tomentosa") { $nom = "Tibicina picta" } # corrections taxonomiques entrée
- if ($cof -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans Catalogue of Life" }
+ if ($col -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans Catalogue of Life" }
else {
- $Sourcecode = (Invoke-WebRequest "https://api.checklistbank.org/dataset/9916/taxon/$cof" | ConvertFrom-Json).name.scientificName
+ $Sourcecode = (Invoke-WebRequest "https://api.checklistbank.org/dataset/9916/taxon/$col" | ConvertFrom-Json).name.scientificName
if ($nom -eq $Sourcecode) { Write-Host " > Le code espèce de $nom dans Catalogue of Life est "-NoNewline; Write-Host "correct" -ForegroundColor Green }
else {
Write-Host " > Le code espèce de $nom dans Catalogue of Life est "-NoNewline; Write-Host "incorrect" -ForegroundColor Red
- $cof_erreurs = $cof_erreurs + " " + $nom
- $cof_erreurs > "./BDD/CATALOGUE_OF_LIFE/erreurs.txt"
+ $col_erreurs = $col_erreurs + " " + $nom
+ $col_erreurs > "./BDD/CATALOGUE_OF_LIFE/erreurs.txt"
}
}
- if ($nom -eq "Tibicina picta") { $nom = "Tibicina tomentosa" } # corrections taxonomiques sortie
# FAUNA-EUROPEA
if ($fe -eq "") { Write-Host " > $nom "-NoNewline; Write-Host "n'existe pas" -ForegroundColor Yellow -NoNewline;Write-Host " dans Fauna-Europea" }
@@ -152,6 +169,13 @@ else {
Remove-item "./BDD/INPN/erreurs.txt"
}
+if (-not(Test-Path -Path "./BDD/WAD/erreurs.txt" -PathType Leaf)) { Write-Host " > Tous les codes espèces de World Auchenorrhyncha Database sont "-NoNewline; Write-Host "corrects" -ForegroundColor Green }
+else {
+ Write-Host " > Quelques codes espèces sont "-NoNewline; Write-Host "en erreur" -ForegroundColor Red -NoNewline;Write-Host " dans World Auchenorrhyncha Database"
+ $wad_txt = (Get-Content "./BDD/WAD/erreurs.txt") + "`n`n"
+ Remove-item "./BDD/WAD/erreurs.txt"
+}
+
if (-not(Test-Path -Path "./BDD/INATURALIST/erreurs.txt" -PathType Leaf)) { Write-Host " > Tous les codes espèces de iNaturalist sont "-NoNewline; Write-Host "corrects" -ForegroundColor Green }
else {
Write-Host " > Quelques codes espèces sont "-NoNewline; Write-Host "en erreur" -ForegroundColor Red -NoNewline;Write-Host " dans iNaturalist"
@@ -178,7 +202,7 @@ else {
if (-not(Test-Path -Path "./BDD/CATALOGUE_OF_LIFE/erreurs.txt" -PathType Leaf)) { Write-Host " > Tous les codes espèces de Catalogue of Life sont "-NoNewline; Write-Host "corrects" -ForegroundColor Green }
else {
Write-Host " > Quelques codes espèces sont "-NoNewline; Write-Host "en erreur" -ForegroundColor Red -NoNewline;Write-Host " dans Catalogue of Life"
- $cof_txt = (Get-Content "./BDD/CATALOGUE_OF_LIFE/erreurs.txt") + "`n`n"
+ $col_txt = (Get-Content "./BDD/CATALOGUE_OF_LIFE/erreurs.txt") + "`n`n"
Remove-item "./BDD/CATALOGUE_OF_LIFE/erreurs.txt"
}
@@ -191,7 +215,7 @@ else {
Remove-item "./BDD/FAUNA-EUROPEA/erreurs.txt"
}
-$erreurs = $ff_txt + $inpn_txt + $inat_txt + $obs_txt + $gbif_txt + $cof_txt + $fe_txt
+$erreurs = $ff_txt + $inpn_txt + + $wad_txt + $inat_txt + $obs_txt + $gbif_txt + $col_txt + $fe_txt
if ($erreurs -eq $null) {Write-Host "Tous les codes espèces sont corrects !" -ForegroundColor Green}
else {