Formatting csv files for vocabulary import in Nuxeo Studio
The simple vocabulary csv import file format is: id,label,obsolete where the first two columns are strings, and the third is 0 or 1.
With the child vocabulary you can use the id,label,parent,obsolete, where the parent field entries have to match ids of another vocabulary, considered its parent.
What is the correct csv import file format for the hierarchical vocabulary?
Since version 2.5.1, Studio provides links to sample CSV files on the download page: they can be downloaded and modified to fit the expected format.
The hierarchical vocabulary has the same general structure as the child vocabulary with one notable difference: the importable file includes both the child and the parent entries.
- commas have not been displayed for legibility.
- the format is the following: id,label,parent,obsolete, the headings are however not to be included in the import file.
|p1ch1||Child 1 of Parent 1||p1||0|
|p2ch1||Child 1 of Parent 2||p2||0|
|p2ch2||Child 2 of Parent 2||p2||0|
As you can see the parent entries have an empty value in the parent column. This format is importable when you want to create a hierarchical vocabulary in Nuxeo Studio. The hierarchical vocabulary is currently the recommended way for working with chained vocabularies/vocabulary hierarchies.