Project

General

Profile

1
##### Vars/functions
2

    
3
coreMaps := DwC-VegBIEN.specimens.csv VegX-VegBIEN.organisms.csv
4
chRootMaps := VegX-VegBIEN.plots.csv VegX-VegBIEN.stems.csv
5
all := $(wildcard for_review/*) $(chRootMaps)
6

    
7
##### General targets
8

    
9
all: _always $(coreMaps) $(chRootMaps)
10
	./review
11

    
12
.SUFFIXES:
13

    
14
_always:
15
.PHONY: _always
16

    
17
clean: _always
18
	$(RM) $(all)
19

    
20
remake: _always clean all ;
21

    
22
##### Core maps cleanup
23

    
24
bin := ../bin
25

    
26
$(coreMaps): %: .%.last_cleanup
27
	$(bin)/in_place $@ $(bin)/simplify_xpath
28
	$(bin)/in_place $@ $(bin)/sort 1 0
29
	touch -r $@ $<
30
.PRECIOUS: .%.last_cleanup
31
# Ignore last_cleanup file if it doesn't exist
32
.%.last_cleanup:
33

    
34
##### Maps generated with ch_root
35

    
36
chRoot = $(bin)/ch_root <$< >$@
37

    
38
VegX-VegBIEN.plots.csv: VegX-VegBIEN.organisms.csv
39
	env \
40
left_in_root='/*s/individualOrganismObservation/*ID->/*s/plotObservation' \
41
left_out_root='/*s/plotObservation' \
42
right_in_root='/taxonoccurrence/*_id/locationevent' \
43
right_out_root='/locationevent' \
44
$(chRoot)
45

    
46
VegX-VegBIEN.stems.csv: VegX-VegBIEN.organisms.csv
47
	env \
48
left_in_root='/*s/individualOrganismObservation->/*s/individualOrganismObservation[relatedItem[relationshipType=stemParent]/relatedItemID]' \
49
left_out_root='/*s/individualOrganismObservation[relatedItem[relationshipType=stemParent]/relatedItemID]' \
50
right_in_root='/taxonoccurrence/aggregateoccurrence/*_id/plantobservation/stemobservation' \
51
right_out_root='/stemobservation' \
52
$(chRoot)
(4-4/9)