XPath reversing¶
Reversing so that they start with location instead of stemobservation/plantobservation/specimenreplicate
DwC2-VegBIEN.specimens.csv
¶
DwC2-VegBIEN.specimens.csv
bin/in_place mappings/DwC2-VegBIEN.specimens.csv env left_in_root= left_out_root= right_in_root= right_out_root= left_connect= right_connect='/location/locationevent' bin/ch_root_via
In the map spreadsheet, remove the following (order matters):/specimenreplicate/*_id/locationevent /locationevent/*_id/location
Test and commit
VegX-VegBIEN.stems.csv
input¶
bin/in_place mappings/VegX-VegBIEN.stems.csv env left_in_root= left_out_root= right_in_root='/stemobservation' right_out_root='/stemobservation' left_connect='/*s/plot->/*s/plotObservation[*UniqueIdentifierID]->/*s/individualOrganismObservation[*ID]->' right_connect='/stemobservation' bin/ch_root_via
- The new root (inlined with the paths) will be:
/*s/plot->/*s/plotObservation[*UniqueIdentifierID]->/*s/individualOrganismObservation[*ID]->/*s/individualOrganismObservation[relatedIndividual/relatedItem[itemRelationship=stemParent]/relatedItemID]
- The new root (inlined with the paths) will be:
Do the same for all the VegX via maps:VegX.plots.csv
:for map in inputs/*/maps/VegX.plots.csv; do bin/in_place "$map" env left_in_root= left_out_root= right_in_root='/*s/plotObservation' right_out_root= left_connect= right_connect='/*s/plot->/*s/plotObservation[*UniqueIdentifierID]' bin/ch_root_via done
VegX.organisms.csv
:for map in inputs/*/maps/VegX.organisms.csv; do bin/in_place "$map" env left_in_root= left_out_root= right_in_root='/*s/individualOrganismObservation' right_out_root= left_connect= right_connect='/*s/plot->/*s/plotObservation[*UniqueIdentifierID]->/*s/individualOrganismObservation[*ID]' bin/ch_root_via done
VegX.stems.csv
:for map in inputs/*/maps/VegX.stems.csv; do bin/in_place "$map" env left_in_root= left_out_root= right_in_root='/*s/individualOrganismObservation[relatedIndividual/relatedItem[itemRelationship=stemParent]/relatedItemID]' right_out_root= left_connect= right_connect='/*s/plot->/*s/plotObservation[*UniqueIdentifierID]->/*s/individualOrganismObservation[*ID]->/*s/individualOrganismObservation[relatedIndividual/relatedItem[itemRelationship=stemParent]/relatedItemID]' bin/ch_root_via done
In the map spreadsheet and all VegX via maps (VegX.{plots,organisms,stems}.csv
), remove the following (order matters):->/*s/individualOrganismObservation[relatedIndividual/relatedItem[itemRelationship=stemParent]/relatedItemID]/relatedIndividual/relatedItem[itemRelationship=stemParent]/relatedItemID->/*s/individualOrganismObservation ->/*s/individualOrganismObservation[*ID]/*ID->/*s/plotObservation ->/*s/plotObservation[*UniqueIdentifierID]/*UniqueIdentifierID->/*s/plot
Updatemappings/Makefile
VegX section- Update
inputs/CTFS/maps/VegX.organisms.csv
input- Need to move organisms prefix to root so it's used for iteration
- Update left side using similar procedure to
VegX-VegBIEN.stems.csv
input above?
Test and commit
VegX-VegBIEN.stems.csv
output¶
bin/in_place mappings/VegX-VegBIEN.stems.csv env left_in_root= left_out_root= right_in_root= right_out_root= left_connect= right_connect='/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation' bin/ch_root_via
In the map spreadsheet, remove the following (order matters):/stemobservation/*_id/plantobservation /plantobservation/*_id/aggregateoccurrence /aggregateoccurrence/*_id/taxonoccurrence /taxonoccurrence/*_id/locationevent /locationevent/*_id/location (Manually exclude parent_id mappings from the removal) /aggregateoccurrence/plantobservation/aggregateoccurrence:[@merge=1]/taxonoccurrence
Fix mappings containingparent_id
,:[@merge=1]
,_if
, and_ignore
Updatemappings/Makefile
VegX sectionTest and commit- Note that the inserted rows count will be lower for datasources that do not map to aggregateoccurrence, plantobservation, etc. because these unused tables now aren't created