Skip to content

Commit

Permalink
Intégration de World Auchenorrhyncha Database + correction de codes e…
Browse files Browse the repository at this point in the history
…spèces
  • Loading branch information
Adri-Charbonneau committed Oct 2, 2023
1 parent f1d5160 commit 499a269
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/PROCESSUS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions BDD/WAD/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Base de donnée - World Auchenorrhyncha Database</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="5; URL=https://cartes.cigalesdefrance.fr">
<link rel="icon" type="image/x-icon" href="https://www.cigalesdefrance.fr/_media/favicon.ico">
</head>
<body>
<h1>BASE DE DONNÉE - WORLD AUCHENORRHYNCHA DATABASE</h1>
</body>
</html>
6 changes: 3 additions & 3 deletions CIGALES-CODES.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
46 changes: 35 additions & 11 deletions SCRIPTS/CODES.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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" }
Expand All @@ -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 {
Expand Down Expand Up @@ -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>(.*)<\/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 {
Expand All @@ -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" }
Expand All @@ -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" }
Expand Down Expand Up @@ -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"
Expand All @@ -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"
}

Expand All @@ -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 {
Expand Down

0 comments on commit 499a269

Please sign in to comment.