...
Info |
---|
|
Advanced: Specifying Multiple Metadata and Enumeration Definitions in a Single Cell
It is possible to specify multiple key-value pairs for metadata and enumerations in a single spreadsheet cell by using the separator
and keyValueSeparator
attributes. For example, this entry in the XML mapping:
Code Block |
---|
<enumerations separator="\n" keyValueSeparator="|">Enumerations</enumerations> |
would allow a definition like this:
...
0|Not known
1|Male
2|Female
9|Not specified
...
Similarly for metadata. It also allows arbitrary metadata keys whereas normally each key must be specified in the XML mapping file. Enumerations can just have keys in which case there is no keyValueSeparator
:
Code Block |
---|
<enumerations separator="\n">Enumerations</enumerations> |
would allow this sort of definition:
...
yes
no
unknown
Metadata must always have both a key and value so must have both separators (or neither).
If a metadata entry has no separators, it (the column name) is used as the metadata key and the value is the value in the cell.
Steps
Firstly, prepare your excel file for import. Ensure the Excel file you wish to import has a header row at the top with each column with a unique header name that is used to identify that column. It’s also important to check that any elements which are reused throughout the spreadsheet i.e. data type names are spelled the same to avoid creating duplicate catalogue elements.
...
Next, open up your XML mapping file. A blank template XML file has been created here:
View file name TemplateMetadataXMLFile.xml
(Alternatively it can be generated from the Metadata XML Schema found on the importer pages:
)View file name Metadata XML Schema - headersMap.xsd It is now time to map the header row to each of the catalogue elements/properties. Simply enter the column header names into the correct sections. In this example file they have been labelled as
EnterColumnHeaderHere
. Simply replace this text with the name of your column. For example :<dataClassID>EnterColumnHeaderHere</dataClassID>
→<dataClassID>Data_Class</dataClassID>
If you have used enumerations or multiple metadata definitions, remember to also specify the separator you have used. See above section below for further details: https://metadata.atlassian.net/wiki/spaces/MDX/pages/edit-v2/2549481480#Advanced%3A-Specifying-Multiple-Metadata-and-Enumeration-Definitions-in-a-Single-Cell
Remove any sections that are not present in your spreadsheet. For example, if you have no additional metadata associated with each data element, you can delete the following line.
...
Ensure your excel spreadsheet columns follow the order of the XML file e.g. Data Class, Data Class Description Data Element, Data Element Description etc.
On the Import a new data model with Structural Metadata (Excel) page , upload your Excel and XML files and then click Submit.
...
Advanced: Specifying Multiple Metadata and Enumeration Definitions in a Single Cell
It is possible to specify multiple key-value pairs for metadata and enumerations in a single spreadsheet cell by using the separator
and keyValueSeparator
attributes. For example, this entry in the XML mapping:
Code Block |
---|
<enumerations separator="\n" keyValueSeparator="|">Enumerations</enumerations> |
would allow a definition like this:
0|Not known |
Similarly for metadata. It also allows arbitrary metadata keys whereas normally each key must be specified in the XML mapping file. Enumerations can just have keys in which case there is no keyValueSeparator
:
Code Block |
---|
<enumerations separator="\n">Enumerations</enumerations> |
would allow this sort of definition:
yes |
Metadata must always have both a key and value so must have both separators (or neither).
If a metadata entry has no separators, it (the column name) is used as the metadata key and the value is the value in the cell.
Info |
---|
The template XML file contains each variation of enumeration (with a separator or with a key value separator) and metadata (without a separator, with a separator, with a keyvalue separator) of XML mapping , please only fill out the relevant lines. |
...
Worked Examples
Example 1 (Simple)
...