Project

General

Profile

« Previous | Next » 

Revision 730

join: Report which input mappings are missing a mapping in the join map

View differences:

inputs/SALVIAS/maps/VegBIEN.organisms.csv
38 38
PlotCode,,"Brad: Same as plotCode, above"
39 39
SourceVoucher,,"Brad: OMIT. This is the verbatim text, which includes both collectors name and collection number. I would use coll_number, below."
40 40
SpAuthStatus,,
41
canopy_form,,Brad: Should also be userDefined for VegBank. 
42
canopy_position,,Brad: Should also be userDefined for VegBank. 
41
canopy_form,,** No join mapping for /simpleUserdefined[name=canopyForm]/value ** Brad: Should also be userDefined for VegBank. 
42
canopy_position,,** No join mapping for /simpleUserdefined[name=canopyPosition]/value ** Brad: Should also be userDefined for VegBank. 
43 43
coll_inits,,
44 44
collector_code,,Brad: OMIT
45 45
common_name,,
......
51 51
height_m_commercial,,
52 52
ind_id,,Brad: OMIT
53 53
infra_auth_1,,
54
liana_infestation,,Brad: Should also be userDefined for VegBank. 
54
liana_infestation,,** No join mapping for /simpleUserdefined[name=lianaInfestation]/value ** Brad: Should also be userDefined for VegBank. 
55 55
morphocf,,
56 56
morphoname,,
57 57
name_status,,"Brad: OMIT. Except, note that if species_status=3, this indicate that name is a morphospecies and not a standard latin name. Not exactly sure how to use this in BIEN, but could be useful during the name-scrubbing process with TNRS."
bin/join
16 16
    reader = csv.reader(stream)
17 17
    map_1_in, map_1_out = reader.next()[:2]
18 18
    for row in reader:
19
        if row[1] != '': map_1[row[0]] = row[1]
19
        if row[0] != '': map_1[row[0]] = row[1]
20 20
    stream.close()
21 21
    
22 22
    # Join map 1 to map 0
......
28 28
    cols[1] = map_1_out
29 29
    writer.writerow(cols)
30 30
    for row in reader:
31
        row[1] = map_1.get(row[1], '')
31
        if row[1] != '':
32
            try: row[1] = map_1[row[1]]
33
            except KeyError:
34
                row[2] = '** No join mapping for '+row[1]+' ** '+row[2]
35
                row[1] = ''
32 36
        writer.writerow(row)
33 37

  
34 38
main()

Also available in: Unified diff