14 | | == Batch loading of data == |
15 | | MOLGENIS also provides methods to quickly load large data sets from comma or tab separated data files, both in the MolgenisUserInterfaceas well as in the MolgenisJavaApi . This works if: |
16 | | |
17 | | * The column headers match the entity `field `definitions as defined in !MolgenisDatabaseXml file(order doesn’t matter) |
18 | | * A special case are !XrefFields that either can use the xref_field or the xref_label. For example in the case of AddressBookExample ‘contact_id’ and ‘contact_displayname’. |
19 | | |
20 | | For example: Load data for Contact. Within the MOLGENIS user interface for Contacts choose ‘File’ and then ‘Add in batch’. |
21 | | |
22 | | In the CSV data dialog paste the following comma seperated values: |
23 | | |
24 | | {{{ |
25 | | displayname,lastname,firstname,mid_initials,birthday |
26 | | |
27 | | Prof.dr. R Bischoff,Bischoff,Rainer,, |
28 | | |
29 | | Dr. R Breitling,Breitling,Rainer,, |
30 | | |
31 | | Prof.dr. RC Jansen,Ritsert,Jansen,C, |
32 | | }}} |
33 | | Load data for Address. In the dialog for Example data for Address again choose ‘File’ and then ‘Add in batch’. Set the ‘address_type’ to ‘work’ as constant for all addresses to be loaded (otherwise you get an error!). Then paste in the CSV data dialog: |
34 | | |
35 | | {{{ |
36 | | phone,contact_displayname |
37 | | |
38 | | +31 (0)50 3633338,Prof.dr. R Bischoff |
39 | | |
40 | | +31 (0)50-3638088,Dr. R Breitling |
41 | | |
42 | | +31 (0)50-3638089,Prof.dr. RC Jansen |
43 | | }}} |
44 | | Notice the cross reference by ‘xref_label’ using ‘contact_displayname’! |
45 | | |
46 | | ---- |
47 | | [http://gbic.target.rug.nl/#_ftnref1 "[1]"] These example data was copied from http://www.nbic.nl/nbic/network/?city=Groningen |