mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
4.8 KiB
4.8 KiB
Darwin Core Archive export (v1, admin-only)
Issue: nowcommunity/nowdatabase#1150
This repository includes an admin-only Darwin Core Archive (DwC-A) export intended for initial testing.
For spreadsheet compatibility, embedded line breaks in exported CSV cell values are normalized to spaces. This keeps each exported record on one physical CSV line.
Access
- Backend route:
GET /species/export/dwc-archive(Role.Admin only) - The frontend exposes this as an export option on the
/speciespage for administrators.
Output
The downloaded ZIP contains:
taxon.csv(DwC Taxon core)measurementorfact.csv(DwC MeasurementOrFact extension)meta.xml(DwC-A descriptor)eml.xml(minimal placeholder metadata; TODOs included)
v1 field mappings
taxon.csv
One row per com_species record.
Columns:
taxonID=com_species.species_idtaxonID=NOW:<species_id>nomenclaturalCode=ICZNscientificName=${genus_name} ${species_name} ${sp_author}(trimmed; authorship appended when present)genericName=genus_name(only whenspecies_nameis a simple epithet; no spaces or dots)scientificNameAuthorship=sp_authorvernacularName=common_nametaxonRank:orderiffamily_namecontains.familyifgenus_namecontains.genusifspecies_namecontains a space or.speciesifunique_identifieris-subspeciesifunique_identifieris a single lowercase word
taxonomicStatus=taxonomic_status(fallback:accepted)kingdom=Animaliaphylum=Chordataclass=class_nameorder=order_namesuperfamily=subclass_or_superorder_name(only when it ends with-oidea)family=family_namesubfamily=subfamily_name(only when it ends with-inae)tribe=subfamily_name(only when it ends with-ini)subtribe=subfamily_name(only when it ends with-ina)genus=genus_namespecificEpithet=species_nameinfraspecificEpithet=unique_identifier(only when meaningful and not-)higherClassification=class_name|subclass_or_superorder_name|order_name|suborder_or_superfamily_name|family_name|subfamily_name(skip empty /-)taxonRemarks=sp_comment
Note:
- v1 intentionally exports only
com_speciesrows as taxa (no synonyms yet).
measurementorfact.csv
Long-format measurements linked by taxonID.
Columns:
taxonID=NOW:<species_id>measurementID=NOW:<species_id>:<field_name>parentMeasurementID= empty by default; for crown-type segments points to the calculated parent rowmeasurementType/measurementUnit/measurementValueper field mappingverbatimMeasurementType= original DB field name (e.g.diet1,body_mass)measurementMethod= Pantheria VSP field description where available (https://www.pantherion.com/dbmanual97/VSP.html)
Calculated tooth rows (emitted only when at least one segment field is present):
NOW:<species_id>:developmental_crown_type(value is a 5-char concatenation ofcusp_shape,cusp_count_buccal,cusp_count_lingual,loph_count_lon,loph_count_trs, using-for missing)NOW:<species_id>:functional_crown_type(value is a 5-char concatenation offct_al,fct_ol,fct_sf,fct_ot,fct_cm, using-for missing)
v1 includes these com_species fields (rows emitted only when source value is non-null and non-empty; - is treated as empty):
straingenetaxon_statusbody_mass→ type:body mass, unit:gbrain_mass→ type:brain mass, unit:gsv_lengthsd_sizesd_displaytshmsymph_mobrelative_blade_lengththtdiet1→ type:diet category 1diet2→ type:diet category 2diet3→ type:diet category 3diet_description→ type:diet descriptionrel_fibselectivitydigestionfeedinghab1feedinghab2shelterhab1shelterhab2locomo1→ type:locomotion 1locomo2→ type:locomotion 2locomo3→ type:locomotion 3hunt_forageactivity→ type:activitycrowntype→ type:crown typemicrowear→ type:microwearmesowear→ type:mesowearhorizodontycusp_shapecusp_count_buccalcusp_count_lingualloph_count_lonloph_count_trsfct_alfct_olfct_sffct_otfct_cmmw_or_highmw_or_lowmw_cs_sharpmw_cs_roundmw_cs_bluntmw_scale_minmw_scale_maxmw_value→ type:mesowear valuepop_strucsp_status
Extension points (TODOs)
- Add synonym export from
com_taxa_synonym(either separate Taxon rows or a dedicated extension). - Add additional traits/measurements from
com_species. - Replace the placeholder
eml.xmlgenerator with a real dataset-level EML implementation.