nahpu_dwc
A utility crate for mapping and converting Nahpu project data into the Darwin Core (DwC) JSON format. It automatically pulls the Nahpu drift database schema and maps its struct fields natively into the dwc and dcterms namespaces.
Example Usage
use convert_to_dwc_json;
use Serialize;
Darwin Core Data Package (DwC-DP) Export
You can seamlessly export entire collections of structs into a standard Darwin Core Data Package (which conforms to the Frictionless Data Package specification) by using DataPackageBuilder.
use DataPackageBuilder;
use Serialize;
use Path;
Simple Darwin Core XML Export
To natively export an array of structs into the flat XML format compliant with the Simple Darwin Core specification, you can use export_to_dwc_xml:
use export_to_dwc_xml;
use Serialize;
Nahpu to Darwin Core Mappings
The following table summarizes how Nahpu database fields map to official Darwin Core terms.
| Nahpu Table | Nahpu Field | Darwin Core Term |
|---|---|---|
| Project | uuid |
dcterms:identifier |
name |
dwc:datasetName |
|
description |
dwc:datasetDescription |
|
principalInvestigator |
dwc:recordedBy |
|
location |
dwc:location |
|
startDate, endDate |
dwc:eventDate |
|
created |
dcterms:created |
|
lastAccessed |
dcterms:modified |
|
| Site | siteId |
dwc:locationID |
projectUuid |
dwc:datasetID |
|
leadStaffId |
dwc:recordedBy |
|
siteType |
dwc:locationRemarks |
|
country |
dwc:country |
|
stateProvince |
dwc:stateProvince |
|
county |
dwc:county |
|
municipality |
dwc:municipality |
|
locality |
dwc:verbatimLocality |
|
remark |
dwc:locationRemarks |
|
habitatType, habitatCondition, habitatDescription |
dwc:habitat |
|
| Coordinate | siteId |
dwc:locationID |
decimalLatitude |
dwc:decimalLatitude |
|
decimalLongitude |
dwc:decimalLongitude |
|
elevationInMeter |
dwc:minimumElevationInMeters |
|
datum |
dwc:geodeticDatum |
|
uncertaintyInMeters |
dwc:coordinateUncertaintyInMeters |
|
gpsUnit, notes |
dwc:georeferenceRemarks |
|
| CollEvent | id |
dwc:eventID |
projectUuid |
dwc:datasetID |
|
siteId |
dwc:locationID |
|
startDate, endDate |
dwc:eventDate |
|
startTime, endTime |
dwc:eventTime |
|
primaryCollMethod |
dwc:samplingProtocol |
|
collMethodNotes |
dwc:samplingEffort |
|
| CollPersonnel | eventId |
dwc:eventID |
personnelId |
dwc:recordedByID |
|
name |
dwc:recordedBy |
|
| CollEffort | eventId |
dwc:eventID |
method, brand |
dwc:samplingProtocol |
|
count, size |
dwc:sampleSizeValue |
|
notes |
dwc:samplingEffort |
|
| Taxonomy | id |
dwc:taxonID |
taxonClass |
dwc:class |
|
taxonOrder |
dwc:order |
|
taxonFamily |
dwc:family |
|
genus |
dwc:genus |
|
specificEpithet |
dwc:specificEpithet |
|
authors |
dwc:scientificNameAuthorship |
|
commonName |
dwc:vernacularName |
|
notes |
dwc:taxonRemarks |
|
citesStatus, redListCategory, countryStatus |
dwc:threatStatus |
|
| Specimen | uuid |
dwc:occurrenceID |
projectUuid |
dwc:datasetID |
|
speciesId |
dwc:taxonID |
|
iDConfidence |
dwc:identificationQualifier |
|
iDMethod |
dwc:identificationRemarks |
|
taxonGroup |
dwc:higherClassification |
|
condition |
dwc:disposition |
|
prepDate, prepTime |
dcterms:modified |
|
collectionDate, captureDate |
dwc:eventDate |
|
collectionTime, captureTime |
dwc:eventTime |
|
trapType, methodId, collMethodId |
dwc:samplingProtocol |
|
coordinateId |
dwc:locationID |
|
catalogerId, collPersonnelId |
dwc:recordedBy |
|
fieldNumber |
dwc:recordNumber |
|
collEventId |
dwc:eventID |
|
museumId |
dwc:institutionCode |
|
preparatorId |
dwc:preparations |
|
| SpecimenPart | specimenUuid |
dwc:occurrenceID |
personnelId |
dwc:recordedBy |
|
tissueId |
dwc:materialSampleID |
|
barcodeId |
dwc:otherCatalogNumbers |
|
type, treatment, additionalTreatment |
dwc:preparations |
|
count |
dwc:individualCount |
|
dateTaken |
dwc:eventDate |
|
timeTaken |
dwc:eventTime |
|
museumPermanent, museumLoan |
dwc:disposition |
|
remark, pmi |
dwc:occurrenceRemarks |
|
| Media | primaryId, secondaryId |
dcterms:identifier |
projectUuid |
dwc:datasetID |
|
category |
dcterms:type |
|
tag |
dcterms:subject |
|
taken |
dcterms:created |
|
camera, lenses, additionalExif |
dcterms:description |
|
personnelId |
dcterms:creator |
|
fileName |
dcterms:title |
|
caption |
dcterms:description |