Project

General

Profile

XPath reversing

Reversing so that they start with location instead of stemobservation/plantobservation/specimenreplicate

DwC2-VegBIEN.specimens.csv

  1. 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
  2. In the map spreadsheet, remove the following (order matters):
    /specimenreplicate/*_id/locationevent
    /locationevent/*_id/location
    
  3. Test and commit

VegX-VegBIEN.stems.csv input

  1. 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]
  2. Do the same for all the VegX via maps:
    1. 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
      
    2. 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
      
    3. 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
      
  3. 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
    
  4. Update mappings/Makefile VegX section
  5. 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?
  6. Test and commit

VegX-VegBIEN.stems.csv output

  1. 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
  2. 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
    
  3. Fix mappings containing parent_id, :[@merge=1], _if, and _ignore
  4. Update mappings/Makefile VegX section
  5. Test 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