Skip to content

Commit

Permalink
Get basisOfrecord with suffix
Browse files Browse the repository at this point in the history
Remove the need for hard-coded fix.

Part of #4
  • Loading branch information
jonatanmindroad committed Dec 9, 2024
1 parent 66413cc commit c709d75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dwca_config/dwca_phytoplankton_ifcb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ fieldMapping:
files:
- - dwca_terms_event.yaml
- _IFCB
- dwca_terms_occurrence.yaml
- - dwca_terms_occurrence.yaml
- _IFCB
- dwca_terms_emof.yaml

taxaWorms:
Expand Down
2 changes: 2 additions & 0 deletions dwca_config/field_mapping/dwca_terms_occurrence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ dwcaOccurrenceContent:
sourceKey: worms_genus
basisOfRecord:
text: MaterialSample
basisOfRecord_IFCB:
text: MachineObservation
recordedBy:
sourceKey: taxonomist
occurrenceRemarks:
Expand Down
4 changes: 0 additions & 4 deletions dwca_generator/dwca_format_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,6 @@ def create_dwca_occurrence(self):
if occurrence_dict.get("scientificName","") == missing_taxa_id:
occurrence_dict["scientificNameID"] = ID

# IFCB fix
if "IFCB" in occurrence_dict.get("dynamicProperties") and occurrence_dict.get("basisOfRecord", "") == "MaterialSample":
occurrence_dict["basisOfRecord"] = "MachineObservation"

# Phytoplankton fix
if all(
key in occurrence_dict and "SHARK_Phytoplankton" in occurrence_dict.get("dynamicProperties", "")
Expand Down

0 comments on commit c709d75

Please sign in to comment.