@@ -74,72 +74,82 @@ For further information about properties, see [here](./dsp-tools-create-ontologi
7474
7575[ not yet implemented]
7676
77+
78+
79+
80+
7781## Create a list from one or several Excel files
7882
83+ With dsp-tools, a JSON list can be created from one or several Excel files. The list can then be inserted into a JSON
84+ ontology and uploaded to a DSP server. It is possible to create multilingual lists. In this case, a separate
85+ Excel file has to be created for each language. The data must be in the first worksheet of each Excel file.
86+ It is important that all the Excel lists have the same structure. So, the translation of a label in one Excel
87+ sheet has to be in the exact same cell than the original was in the other Excel sheet (i.e. same cell index).
88+
89+ ** It is recommended to work from the following templates:
90+ [ description_en.xlsx] ( assets/templates/description_en.xlsx ) : The English list "description"
91+ [ Beschreibung_de.xlsx] ( assets/templates/Beschreibung_de.xlsx ) : Its German counterpart "Beschreibung"**
7992
80- With dsp-tools a JSON list can be created from one or several Excel files. The list can then be inserted into a JSON
81- ontology and uploaded to a DSP server. The expected structure of the Excel files is described
82- [ here] ( ./dsp-tools-create.md#lists-from-excel ) . It is possible to create multilingual lists. In this case, a separate
83- Excel file has to be created for each language. The data has to be in the first worksheet of the Excel file(s).
84- It is important that all the Excel lists have the same structure. So, the translation(s) of a label in one Excel
85- sheet has to be in the exact same cell (i.e. with the same cell index) in its own Excel sheet.
93+ The Excel sheets must have the following structure:
94+ ![ img-list-english-example.png] ( assets/images/img-list-english-example.png )
95+ ![ img-list-german-example.png] ( assets/images/img-list-german-example.png )
8696
8797Only Excel files with file extension ` .xlsx ` are considered. All Excel files have to be located in the same directory.
8898When calling the ` excel ` command, this folder is provided as an argument to the call. The language of the labels has
89- to be provided in the Excel file's file name after an underline and before the file extension, p.ex. ` liste_de.xlsx `
90- would be considered a list with German (` de ` ) labels, ` list_en .xlsx` a list with English ( ` en ` ) labels. The language
91- has to be a valid ISO 639-1 or ISO 639-2 language code .
99+ to be provided in the Excel file's file name after an underline and before the file extension, e.g.
100+ ` Beschreibung_de.xlsx ` would be considered a list with German (` de ` ) labels, ` description_en .xlsx` a list with
101+ English ( ` en ` ) labels. The language has to be one of {de, en, fr, it} .
92102
93- The following example shows how to create a JSON list from two Excel files which are in a directory called ` lists ` .
103+ The following example shows how to create a JSON list from two Excel files which are in a directory called ` listfolder ` .
94104The output is written to the file ` list.json ` .
95105
96106``` bash
97- dsp-tools excel lists list.json
107+ dsp-tools excel listfolder list.json
98108```
99109
100- The two Excel files ` liste_de.xlsx ` and ` list_en.xlsx ` are located in a folder called ` lists ` . ` liste_de.xlsx `
101- contains German labels for the list, ` list_en.xlsx ` contains the English labels.
110+ The two Excel files ` Beschreibung_de.xlsx ` and ` description_en.xlsx ` are located in a folder called ` listfolder ` .
102111
103112```
104- lists
105- |__ liste_de .xlsx
106- |__ list_en .xlsx
113+ listfolder
114+ |__ Beschreibung_de .xlsx
115+ |__ description_en .xlsx
107116```
108117
109- For each list node, the ` label ` s are read from the Excel files. The language code, provided in the file name, is then
110- used for the labels. As node ` name ` , a simplified version of the English label is taken if English is one of the
118+ For each list node, the labels are read from the Excel files. The language code, provided in the file name, is then
119+ used for the labels. As node name, a simplified version of the English label is taken if English is one of the
111120available languages. If English is not available, one of the other languages is chosen (which one depends on the
112121representation of the file order). If there are two node names with the same name, an incrementing number is appended to
113122the ` name ` .
114123
115124``` JSON
116125{
117- "name" : " sand " ,
126+ "name" : " description " ,
118127 "labels" : {
119- "de" : " Sand " ,
120- "en" : " sand "
128+ "de" : " Beschreibung " ,
129+ "en" : " description "
121130 },
122131 "nodes" : [
123132 {
124- "name" : " fine-sand" ,
125- "labels" : {
126- "de" : " Feinsand" ,
127- "en" : " fine sand"
128- }
129- },
130- {
131- "name" : " medium-sand" ,
132- "labels" : {
133- "de" : " Mittelsand" ,
134- "en" : " medium sand"
135- }
136- },
137- {
138- "name" : " coarse-sand" ,
133+ "name" : " first-sublist" ,
139134 "labels" : {
140- "de" : " Grobsand" ,
141- "en" : " coarse sand"
142- }
135+ "de" : " erste Unterliste" ,
136+ "en" : " first sublist"
137+ },
138+ "nodes" : [
139+ {
140+ "name" : " first-subnode" ,
141+ "labels" : {
142+ "de" : " erster Listenknoten" ,
143+ "en" : " first subnode"
144+ },
145+ "nodes" : [
146+ {
147+ ...
148+ }
149+ ]
150+ },
151+ ...
152+ ]
143153 }
144154 ]
145155}
0 commit comments